261. Graph Valid Tree (Medium)
You have a graph of n nodes labeled from 0 to n - 1. You are given an integer n and a list of edges where edges[i] = [ai, bi] indicates that there is an undirected edge between nodes ai and bi in the graph.
Welcome to Lan's Blog
You have a graph of n nodes labeled from 0 to n - 1. You are given an integer n and a list of edges where edges[i] = [ai, bi] indicates that there is an undirected edge between nodes ai and bi in the graph.
Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list of strings.
Given a string s that contains parentheses and letters, remove the minimum number of invalid parentheses to make the input string valid.
Design an iterator to flatten a 2D vector. It should support the next and hasNext operations.
Given a string expression of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. You may return the answer in any order.
Given an integer n, return true if it is a power of two. Otherwise, return false.An integer n is a power of two, if there exists an integer x such that n == 2^x.
Design Add and Search Words Data Structure
感恩节假期中断了刷题,沉迷于半小时漫画系列... 补上月25进度。
Given two integers left and right that represent the range [left, right], return the bitwise AND of all numbers in this range, inclusive.
Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight).