payalpatra / 30-Days-Of-Code

30 Days Of Code πŸ‘¨β€πŸ’»

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

  1. Find the median of two sorted arrays.
  2. Given a list of items with values and weights, as well as a max weight, find the maximum value you can generate from items where the sum of the weights is less than the max.
  3. Given an array of integers where each value 1 <= x <= len(array), write a function that finds all the duplicates in the array.
  4. Given an unsorted array, find the length of the longest sequence of consecutive numbers in the array.
  5. Given a boolean matrix, update it so that if any cell is true, all the cells in that row and column are true.
  6. Given a directed graph, find the shortest path between two nodes if one exists.
  7. Given a list of array of N integers, Print the sums of all subset in it.
  8. Write a function that returns all permutations of a given list.
  9. Given a string s, find the length of the longest substring without repeating characters.
  10. Given a binary tree, where every node value is a Digit from 1-9 .Find the sum of all the numbers which are formed from root to leaf paths.
  11. Given an n x m array where all rows and columns are in sorted order, write a function to determine whether the array contains an element x.
  12. Given an unsorted array( A )of size N that contains only non-negative integers, find a continuous sub-array which adds to a given number S.
  13. Implement a binary tree with a method getRandomNode() that returns a random node.
  14. Given a linked list, write a function that prints the nodes of the list in reverse order.
  15. Given a binary tree, write a function to determine whether the tree is balanced.
  16. Given a stack, sort the elements in the stack using one additional stack.
  17. Given a linked list, determine whether it contains a cycle.
  18. Given an unsorted linked list, write a function to remove all the duplicates.
  19. Given a string, write a function to compress it by shortening every sequence of the same character to that character followed by the number of repetitions. If the compressed string is longer than the original, you should return the original string.
  20. Given two integers, write a function to determine whether or not their binary representations differ by a single bit.
  21. Given two strings, write a function that returns the longest common substring length.
  22. Implement priotity queue.
  23. Given an integer array nums that may contain duplicates, return all possible subsets.
  24. Robot bounded in circle.
  25. You are given an array of integers arr, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Return the max sliding window.
  26. Given a non-empty array of integers nums, every element appears twice except for one. Find that single one.
  27. Given a sorted array and a number x, find the pair in array whose sum is closest to x
  28. Given an m x n matrix, return all elements of the matrix in spiral order.
  29. Given a 2D integer array matrix, return the transpose of matrix.
  30. Given an unsorted integer array nums, return the smallest missing positive integer.

About

30 Days Of Code πŸ‘¨β€πŸ’»


Languages

Language:JavaScript 100.0%