C++,
time: O(n^2)
space: O(0)
class Solution {public: /** * @param str: a string * @return: a boolean */ bool isUnique(string &str) { // write your code here for (int i=0; i
C++,
time: O(n)
space: O(n)
1 class Solution { 2 public: 3 /** 4 * @param str: a string 5 * @return: a boolean 6 */ 7 bool isUnique(string &str) { 8 // write your code here 9 string tmp;10 for (int i=0; i