13. Roman to Integer |
148 ms |
36.5 MB |
|
2235. Add Two Integers |
25 ms |
26.7 MB |
|
2236. Root Equals Sum of Children |
111 ms |
39.4 MB |
|
1480. Running Sum of 1d Array |
254 ms |
41.7 MB |
Using Separate Space |
1480. Running Sum of 1d Array |
147 ms |
43.2 MB |
Using Input Array for Output |
1672. Richest Customer Wealth |
135 ms |
37.6 MB |
|
412. Fizz Buzz |
153 ms |
54.2 MB |
Naive Approach If-ElseIf-Else |
412. Fizz Buzz |
183 ms |
47.1 MB |
String Concatenation |
1342. Number of Steps to Reduce a Number to Zero |
33 ms |
25.1 MB |
|
1342. Number of Steps to Reduce a Number to Zero |
27 ms |
26.7 MB |
Using bitwise operations |
876. Middle of the Linked List |
102 ms |
36.5 MB |
Find size, iterate half of it |
876. Middle of the Linked List |
121 ms |
36.5 MB |
Two pointers. One moves by two nodes |
383. Ransom Note |
147 ms |
40.4 MB |
|
1337. The K Weakest Rows in a Matrix |
276 ms |
44.7 MB |
Using Tuples<soldiers,row> |
1337. The K Weakest Rows in a Matrix |
321 ms |
44.9 MB |
Reuse input matrix and sort by 0-column |
1337. The K Weakest Rows in a Matrix |
188 ms |
44.6 MB |
PriorityQueue as max-heap, binary search for number of soldiers, maintain the max-heap size |
234. Palindrome Linked List |
535 ms |
52.1 MB |
Used Stack thanks to hint in Related Topics |
485. Max Consecutive Ones |
234 ms |
40.6 MB |
|
1295. Find Numbers with Even Number of Digits |
170 ms |
37.7 MB |
Find the number of digits with / operator |
1295. Find Numbers with Even Number of Digits |
149 ms |
37.6 MB |
Convert a number to a string and find its length |
977. Squares of a Sorted Array |
340 ms |
48.8 MB |
Square each element and sort the result array |
977. Squares of a Sorted Array |
192 ms |
48.7 MB |
An O(n) solution with two pointers |
1071. Greatest Common Divisor of Strings JavaScript |
65 ms |
44.3 MB |
It looks like the Euclidean algorithm |
567. Permutation in String |
1943 ms |
51.5 MB |
Approach by trial and error during dubug |