OOP concept
Q: what is OOP?
A: OOP stands for Objects Oriented programming. It is a methodology to design a program using classes and objects. It simplifies the softeare development and maintenance by providing some concepts like Inheritance, Polymorphism, Abstraction, Encapsulation.
What is MVC? Advantages and Disadvantages.
MVC stands for Model, View, Controller. It’s a design pattern which seperates application into three layers of functionality.
twoSum - Array, Object
brute force
1 | const twoSum = (nums, target) => { |
#189 Rotate Array
Given an array, rotate the array to the right by k steps, where k is non-negative.
e.g arr = [1, 2, 3, 4, 5, 6, 7], k = 3.
#344 Reverse String
Given a string, reverse it.
Use two pointers - low and high.1
2
3
4while(low < hight){
swap low and high;
low++ and high--;
}