随笔分类 - online judge:leetcode
摘要:Table holds the x coordinate of some points on x axis in a plane, which are all integers. Write a query to find the shortest distance between two poin
阅读全文
摘要:There is a robot starting at position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) after it
阅读全文
摘要:There is a table A country is big if it has an area of bigger than 3 million square km or a population of more than 25 million. Write a SQL solution t
阅读全文
摘要:A binary tree is univalued if every node in the tree has the same value. Return if and only if the given tree is univalued. Example 1: Example 2: Note
阅读全文
摘要:In a array of size , there are unique elements, and exactly one of these elements is repeated N times. Return the element repeated times. Example 1: E
阅读全文
摘要:Given a binary matrix , we want to flip the image horizontally, then invert it, and return the resulting image. To flip an image horizontally means th
阅读全文
摘要:905. Sort Array By Parity Given an array of non negative integers, return an array consisting of all the even elements of , followed by all the odd el
阅读全文
摘要:709. To Lower Case Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. Example 1: Example 2: E
阅读全文
摘要:804. Unique Morse Code Words International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follo
阅读全文
摘要:929. Unique Email Addresses Every email consists of a local name and a domain name, separated by the @ sign. For example, in , is the local name, and
阅读全文
摘要:771. Jewels and Stones You're given strings representing the types of stones that are jewels, and representing the stones you have. Each character in
阅读全文