319 challenges in the catalogue. Browse freely; sign in to open the editor and submit.
Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters…
Sign in to solvePasswords should never be stored in plain text. If a database is compromised, an attacker can see all user passwords. To prevent this, passwords must be hashed using a one-way cryptographic hash function. However, simple hashing (like MD5…
Sign in to solveGiven a non-empty array of integers nums, every element appears twice except for one. Find that single one. You must implement a solution with a linear runtime complexity and use only constant extra space. Input: nums = [2,2,1] Output: 1…
Sign in to solveGiven the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree. Example 1: Example 2: The number of nodes in the tree is n. 1 <= k <= n <= 10^4 0 <= Node.val…
Sign in to solveDesign an algorithm to encode a list of strings to a single string. The encoded string is then sent over the network and is decoded back to the original list of strings. Please implement encode and decode methods. Example 1: Example 2: 0…
Sign in to solveImplement a Linear Regression model from scratch using gradient descent optimization. Your implementation should be able to fit a linear model to training data and make predictions on new data. Linear regression models the relationship…
Sign in to solveYou are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you can either climb one or two steps. You can either start from the step with index 0, or the step with index 1. Return the…
Sign in to solve