// jQuery
$(document).ready(function() {
// code
})
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution { | |
HashMap<Character, Character> mappings; | |
public Solution() { | |
this.mappings = new HashMap<Character, Character>(); | |
this.mappings.put(')', '('); | |
this.mappings.put('}', '{'); | |
this.mappings.put(']', '['); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Is palindorme*/ | |
public boolean isPalindrome(String s) { | |
char[] = s.toCharArray(); | |
for (int i = 0, j = c.length - 1; i< j;) { | |
if (!Character.isLetterOrDigit(c[i])) i++; | |
else if (!Character.isLetterOrDigit(c[i])) j--; | |
else if(Character.toLowerCase(c[i++]) != Character.toLowerCase(c[j--])) | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
place two pointers at i = 0 & j = arr.length-1 while i < j | |
calculate prod & compare max , if arr[start] > arr[end] | |
end -= 1 else start += 1 | |
O(N) runtime | |
O(1) space | |
*/ | |
public int containerMostWater(int[] arr) { | |
if arr.length < 2 | |
return -1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int factorial(int n) { | |
if (n == 0) | |
return 1; | |
else | |
return n * factorial(n-1); | |
} | |
public int rangeSum(int[] array, int start, int end) { | |
if (start > end) | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Linked list stores a single instance variable that is a pointer to the first Node in the list | |
Insert into a Linked List: | |
Step 1: Create new node | |
Step 2: Set next to current head | |
Step 3: Set the new node to be the head | |
Remove from a Linked List: | |
Step 1: Set the pointer from head to the next node in the list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Design a HashMap | |
// Initialise a node with privat key & value & | |
// Set the node constructor | |
class Node { | |
private int key; | |
private int value; | |
Node(int key, int value){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
om vnr | |
Arrays & Strings | |
1.) | |
Add a series of number from 1 through n. Sums all the numbers from | |
1 through that integer(both inclusive). Don't include numbers that | |
are divisble by 5 or 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Implement stack using queues: | |
Queue data structures supports enqueue() & dequeue() [First in, first out] | |
Stack data structures supports push() & pop() [Last in, first out] | |
In this, the newly entered element is always at the front of 'q1', so that | |
pop operation just dequeues from 'q1'. 'q2' is used to put every new element | |
at front of 'q1' | |
Stack(s) can be implemented using two queues (q1 & q2). Following operation |