319 challenges in the catalogue. Browse freely; sign in to open the editor and submit.
Given an integer x, return true if x is a palindrome, and false otherwise. An integer is a palindrome when it reads the same forward and backward. For example, 121 is a palindrome while 123 is not. Input: x = 121 Output: true Explanation:…
Sign in to solveGiven a string s, return the number of palindromic substrings in it. A string is a palindrome when it reads the same backward as forward. A substring is a contiguous sequence of characters within the string. Example 1: Example 2: 1 <=…
Sign in to solveGiven a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest…
Sign in to solveImplement a multithreaded FizzBuzz using four concurrent functions: fizz() - called for numbers divisible by 3 (but not 15) buzz() - called for numbers divisible by 5 (but not 15) fizzbuzz() - called for numbers divisible by 15 number() -…
Sign in to solveSeven different symbols represent Roman numerals: I, V, X, L, C, D and M. | Symbol | Value | | :--- | :--- | | I | 1 | | V | 5 | | X | 10 | | L | 50 | | C | 100 | | D | 500 | | M | 1000 | Roman numerals are usually written largest to…
Sign in to solveYou are given a doubly linked list, which contains nodes that have a next pointer, a previous pointer, and an additional child pointer. This child pointer may or may not point to a separate doubly linked list, also containing these special…
Sign in to solveGiven an encoded string, return its decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer. You may…
Sign in to solveGiven an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the number of 1's in the binary representation of i. Input: n = 2 Output: [0,1,1] Explanation: 0 --> 0 1 --> 1 2 --> 10 Input: n = 5…
Sign in to solveGiven an integer array nums and an integer k, return the kth largest element in the array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Can you solve it without sorting? Example 1: Example 2: 1…
Sign in to solveIn this challenge, you are acting as a Security Engineer performing a code review. Below is a snippet of a Node.js/Express application that handles user profiles and search. The code contains exactly 4 major security vulnerabilities (OWASP…
Sign in to solveEach row indicates the ID, name, salary, and manager of an employee. If managerId is NULL, the employee does not have a manager. Write a SQL query to find the employees who earn more than their managers. Return the result table with the…
Sign in to solveBuild a real-time notification system using WebSockets. The system should handle user connections, room-based subscriptions, targeted and broadcast notifications, presence tracking, and reliable message delivery with acknowledgements.…
Sign in to solve