4 Median Of Two Sorted Arrays
Median of Two Sorted Arrays Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n...
Median of Two Sorted Arrays Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n...
Maximum Number of Coins You Can Get There are 3n piles of coins of varying size, you and your friends will take piles of coins as follows: In each step, you will choose **any **3 piles of coins ...
Predict the Winner You are given an integer array nums. Two players are playing a game with this array: player 1 and player 2. Player 1 and player 2 take turns, with player 1 starting first. Bot...
Can I Win In the “100 game” two players take turns adding, to a running total, any integer from 1 to 10. The player who first causes the running total to reach or exceed 100 wins. What if we cha...
Guess Number Higher or Lower II We are playing the Guessing Game. The game will work as follows: I pick a number between 1 and n. You guess a number. If you guess the right number, **you win the...
Palindrome Number Given an integer x, return true* if x is a **palindrome*, and *false otherwise*. Example 1: **Input:** x = 121 **Output:** true **Explanation:** 121 reads as 121 from left...
Sum Game Alice and Bob take turns playing a game, with Alice starting first. You are given a string num of even length consisting of digits and ‘?’ characters. On each turn, a player will do the...
Sum of Two Integers Given two integers a and b, return the sum of the two integers without using the operators + and -. Example 1: **Input:** a = 1, b = 2 **Output:** 3 Example 2: **Inpu...
Construct Binary Tree from Preorder and Inorder Traversal Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traver...
Serialize and Deserialize BST Serialization is converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network c...