Write down your own questions (mostly in javascript and Python3).

Stick to one or two questions a day! Continuously updated…
The serial number below is not the serial number of the subject. The serial number of the subject can be viewed by clicking the link to enter the warehouse (/ \ omega)
  1. Given an array of integers and a target value, find two numbers that neutralize the target value in the array. answer

  2. Given a 32 – bit signed integer, invert the number in the integer. answer

  3. Checks whether an integer is a palindrome. Palindromes are integers that are read in positive order (left to right) and backward order (right to left). answer

  4. Given a Roman numeral, convert it to an integer. Make sure the input is in the range of 1 to 3999. answer

  5. Given a only include a ‘(‘,’) ‘, ‘{‘,’} ‘, ‘/’, ‘ ‘string, to determine whether a string effectively, left and right parentheses must match. answer

  6. Write a function to find the longest public prefix in an array of strings. answer

  7. Given a sorted array, you need to remove duplicate elements in place so that each element appears only once, returning the new length of the removed array. answer

  8. Given an array nums and a value val, you remove all elements with a value equal to val in place, returning the new length of the array. answer

  9. Given a Haystack string and a Needle string, find the first position in the Haystack string where the Needle string appears (starting from 0). If none exists, -1 is returned. answer

  10. Given a sorted array and a target value, find the target value in the array and return its index. If the target value does not exist in the array, return the position where it will be inserted in order. answer

  11. Given a positive integer n (1 ≤ n ≤ 30), print the NTH term of the integer sequence. answer

  12. Given an integer array nums, find a contiguous subarray with the maximum sum (the subarray contains at least one element) and return the maximum sum. answer

  13. Given a string containing only uppercase and lowercase letters and Spaces, return the length of its last word. If the last word does not exist, return 0. answer

  14. Given a non-negative integer represented by a non-empty array of integers, add one to that number. The highest digit is stored at the beginning of an array, where each element stores only one digit. answer

  15. Suppose you’re climbing stairs. It takes n steps to get to the top. You can climb one or two steps at a time. How many different ways can you climb to the top? answer

  16. Given two binary strings, return their sum (in binary). The input is a non-empty string containing only the digits 1 and 0. answer

  17. Implement the int SQRT (int x) function. answer

  18. Given two ordered integer arrays nums1 and nums2, merge nums2 into nums1 so that num1 becomes an ordered array (note: change the original array method)

  19. Given an array of non-empty integers, each element appears twice except for one element. Find the element that appears only once. answer

  20. Given a non-negative integer numRows, generate the former numRows of the Yanghui triangle. answer

  21. Given a nonnegative index k, where k ≤ 33, return the KTH row of the Yang Hui triangle. answer

  22. Given an array, its ith element is the price of a given stock on the ith day. If you only allow one trade (buy and sell one stock), design an algorithm to calculate the maximum profit you can make. Note that you can’t sell a stock before you buy it. answer

  23. Design a stack that supports push, pop, and top operations and can retrieve the smallest element in constant time. answer

  24. Given an ordered array that has been sorted in ascending order, find two numbers that add up to the target number. answer

  25. Given a positive integer, return its corresponding column name in the Excel table. answer

  26. Given an array of size n, find the mode. Mode is the element that occurs more than ⌊ n/2 ⌋ in the array. answer

  27. Given an integer n, return n! Result the number of zeros in the mantissa. answer

  28. Write an algorithm to determine if a number is a “happiness number.” answer

  29. Count the number of primes less than the non-negative integer n. answer

  30. Given two strings s and t, determine whether they are isomorphic. answer

  31. Given an integer array and an integer k, determine whether there are two different indexes I and j in the array such that nums [I] = nums [j] and the absolute value of the difference between I and j is at most K. answer

  32. Given an integer, write a function to determine whether it is a power of two. answer

  33. Write a program to determine whether a given number is ugly. Ugly numbers are positive integers that contain only prime factors 2, 3, and 5. answer

  34. Given a field containing 0, 1, 2… , the sequence of n numbers in n, find 0.. The number in n that does not appear in the sequence. answer

  35. You and your friend, two people, play Nim: there is a pile of rocks on the table, and you take turns removing one to three rocks at a time. Whoever removes the last stone is the winner. You’re the first. You’re smart people. Every step is the best solution. Write a function that determines whether you can win the game with a given number of stones. answer

  36. Given an integer array nums, find the sum of the elements in the range from index I to j (I ≤ j), including I and j. answer

  37. Given an integer, write a function to determine whether it is a power of 3. answer

  38. Given an integer, write a function to determine whether it is a power of 4. answer

  39. Write a function that reverses the input string. answer

  40. Given two arrays, write a function to calculate their intersection. answer

  41. The number of occurrences of each element in the output should be the same as the number of occurrences of the element in both arrays. answer

  42. Given a positive integer num, write a function that returns True if num is a perfect square and False otherwise. Do not use any built-in library functions such as SQRT. answer

  43. Computes the sum of two integers A and b without using the operators + and -. answer