摘要:
Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column are set to 0.There is a same problem in leetcode. We could... 阅读全文
摘要:
Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes, write a method to rotate the image by 90 degrees. Can you do th... 阅读全文
摘要:
Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a2blc... 阅读全文
摘要:
Write a method to replace all spaces in a string with'%20'. You may assume that the string has sufficient space at the end of the string to hold the a... 阅读全文
摘要:
Description: Given two strings, write a method to decide if one is a permutation of the other.We could use the same idea from CTCI 1.1. The only diffe... 阅读全文
摘要:
Since I mainly use Java, this problem seems meaning less for me to implement it with Java. Just use StringBuilder to append each character in string f... 阅读全文
摘要:
Implement an algorithm to determine if a string has all unique characters. What if you can not use additional data structure?In order to know whether ... 阅读全文