-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstring question.txt
2990 lines (2242 loc) · 36.9 KB
/
string question.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
3. Longest Substring Without Repeating Characters
35.9%
Med.
5. Longest Palindromic Substring
34.9%
Med.
6. Zigzag Conversion
50.1%
Med.
8. String to Integer (atoi)
18.4%
Med.
10. Regular Expression Matching
28.7%
Hard
12. Integer to Roman
67.1%
Med.
13. Roman to Integer
63.5%
Easy
14. Longest Common Prefix
44.4%
Easy
17. Letter Combinations of a Phone Number
62.5%
Med.
20. Valid Parentheses
41.5%
Easy
22. Generate Parentheses
76.0%
Med.
28. Find the Index of the First Occurrence in a String
44.0%
Easy
30. Substring with Concatenation of All Words
32.6%
Hard
32. Longest Valid Parentheses
35.2%
Hard
38. Count and Say
57.2%
Med.
43. Multiply Strings
41.4%
Med.
44. Wildcard Matching
29.0%
Hard
49. Group Anagrams
69.9%
Med.
58. Length of Last Word
54.7%
Easy
65. Valid Number
20.8%
Hard
67. Add Binary
54.8%
Easy
68. Text Justification
46.2%
Hard
71. Simplify Path
45.5%
Med.
72. Edit Distance
57.8%
Med.
76. Minimum Window Substring
44.2%
Hard
79. Word Search
44.2%
Med.
87. Scramble String
41.2%
Hard
91. Decode Ways
35.8%
Med.
93. Restore IP Addresses
51.8%
Med.
97. Interleaving String
41.0%
Med.
115. Distinct Subsequences
48.9%
Hard
125. Valid Palindrome
49.5%
Easy
126. Word Ladder II
27.1%
Hard
127. Word Ladder
41.1%
Hard
131. Palindrome Partitioning
70.8%
Med.
132. Palindrome Partitioning II
34.6%
Hard
139. Word Break
47.6%
Med.
140. Word Break II
52.4%
Hard
151. Reverse Words in a String
48.3%
Med.
159. Longest Substring with At Most Two Distinct Characters
55.9%
Med.
161. One Edit Distance
34.4%
Med.
165. Compare Version Numbers
41.7%
Med.
166. Fraction to Recurring Decimal
25.6%
Med.
168. Excel Sheet Column Title
42.4%
Easy
171. Excel Sheet Column Number
65.0%
Easy
179. Largest Number
40.5%
Med.
186. Reverse Words in a String II
55.5%
Med.
187. Repeated DNA Sequences
50.2%
Med.
205. Isomorphic Strings
46.1%
Easy
208. Implement Trie (Prefix Tree)
67.0%
Med.
211. Design Add and Search Words Data Structure
46.3%
Med.
212. Word Search II
36.8%
Hard
214. Shortest Palindrome
40.0%
Hard
224. Basic Calculator
44.4%
Hard
227. Basic Calculator II
44.8%
Med.
241. Different Ways to Add Parentheses
71.9%
Med.
242. Valid Anagram
65.7%
Easy
243. Shortest Word Distance
65.6%
Easy
244. Shortest Word Distance II
61.6%
Med.
245. Shortest Word Distance III
58.8%
Med.
246. Strobogrammatic Number
47.6%
Easy
247. Strobogrammatic Number II
52.8%
Med.
248. Strobogrammatic Number III
42.3%
Hard
249. Group Shifted Strings
66.6%
Med.
257. Binary Tree Paths
65.3%
Easy
266. Palindrome Permutation
68.0%
Easy
267. Palindrome Permutation II
41.9%
Med.
269. Alien Dictionary
36.3%
Hard
271. Encode and Decode Strings
48.4%
Med.
273. Integer to English Words
34.1%
Hard
282. Expression Add Operators
40.7%
Hard
288. Unique Word Abbreviation
26.7%
Med.
290. Word Pattern
42.6%
Easy
291. Word Pattern II
48.5%
Med.
293. Flip Game
64.8%
Easy
297. Serialize and Deserialize Binary Tree
58.0%
Hard
299. Bulls and Cows
50.9%
Med.
301. Remove Invalid Parentheses
48.8%
Hard
306. Additive Number
32.1%
Med.
316. Remove Duplicate Letters
50.5%
Med.
318. Maximum Product of Word Lengths
60.3%
Med.
320. Generalized Abbreviation
59.9%
Med.
331. Verify Preorder Serialization of a Binary Tree
45.7%
Med.
336. Palindrome Pairs
35.8%
Hard
340. Longest Substring with At Most K Distinct Characters
49.2%
Med.
344. Reverse String
79.3%
Easy
345. Reverse Vowels of a String
55.8%
Easy
358. Rearrange String k Distance Apart
39.2%
Hard
383. Ransom Note
63.3%
Easy
385. Mini Parser
39.3%
Med.
387. First Unique Character in a String
62.9%
Easy
388. Longest Absolute File Path
48.0%
Med.
389. Find the Difference
59.5%
Easy
392. Is Subsequence
48.1%
Easy
394. Decode String
60.3%
Med.
395. Longest Substring with At Least K Repeating Characters
45.3%
Med.
399. Evaluate Division
62.5%
Med.
402. Remove K Digits
34.2%
Med.
408. Valid Word Abbreviation
36.4%
Easy
409. Longest Palindrome
55.4%
Easy
411. Minimum Unique Word Abbreviation
39.9%
Hard
412. Fizz Buzz
73.5%
Easy
415. Add Strings
51.6%
Easy
418. Sentence Screen Fitting
36.3%
Med.
420. Strong Password Checker
14.2%
Hard
423. Reconstruct Original Digits from English
51.3%
Med.
424. Longest Repeating Character Replacement
55.9%
Med.
425. Word Squares
53.7%
Hard
428. Serialize and Deserialize N-ary Tree
67.8%
Hard
433. Minimum Genetic Mutation
54.8%
Med.
434. Number of Segments in a String
36.3%
Easy
438. Find All Anagrams in a String
51.6%
Med.
439. Ternary Expression Parser
61.5%
Med.
443. String Compression
56.6%
Med.
449. Serialize and Deserialize BST
58.2%
Med.
451. Sort Characters By Frequency
73.4%
Med.
459. Repeated Substring Pattern
46.4%
Easy
466. Count The Repetitions
31.1%
Hard
467. Unique Substrings in Wraparound String
40.5%
Med.
468. Validate IP Address
27.6%
Med.
471. Encode String with Shortest Length
50.5%
Hard
472. Concatenated Words
49.3%
Hard
474. Ones and Zeroes
48.2%
Med.
481. Magical String
51.8%
Med.
482. License Key Formatting
44.3%
Easy
484. Find Permutation
67.0%
Med.
488. Zuma Game
32.1%
Hard
499. The Maze III
49.7%
Hard
500. Keyboard Row
71.7%
Easy
514. Freedom Trail
58.9%
Hard
516. Longest Palindromic Subsequence
63.4%
Med.
520. Detect Capital
56.2%
Easy
521. Longest Uncommon Subsequence I
61.0%
Easy
522. Longest Uncommon Subsequence II
42.4%
Med.
524. Longest Word in Dictionary through Deleting
51.5%
Med.
527. Word Abbreviation
61.4%
Hard
535. Encode and Decode TinyURL
86.6%
Med.
536. Construct Binary Tree from String
57.7%
Med.
537. Complex Number Multiplication
72.1%
Med.
539. Minimum Time Difference
62.2%
Med.
541. Reverse String II
51.4%
Easy
544. Output Contest Matches
77.3%
Med.
551. Student Attendance Record I
49.4%
Easy
555. Split Concatenated Strings
43.4%
Med.
556. Next Greater Element III
34.3%
Med.
557. Reverse Words in a String III
83.4%
Easy
564. Find the Closest Palindrome
31.6%
Hard
567. Permutation in String
46.6%
Med.
583. Delete Operation for Two Strings
62.9%
Med.
588. Design In-Memory File System
48.1%
Hard
591. Tag Validator
38.9%
Hard
592. Fraction Addition and Subtraction
66.1%
Med.
599. Minimum Index Sum of Two Lists
56.9%
Easy
604. Design Compressed String Iterator
40.0%
Easy
606. Construct String from Binary Tree
69.7%
Med.
609. Find Duplicate File in System
67.6%
Med.
616. Add Bold Tag in String
50.5%
Med.
635. Design Log Storage System
59.2%
Med.
639. Decode Ways II
30.9%
Hard
640. Solve the Equation
44.3%
Med.
642. Design Search Autocomplete System
49.2%
Hard
647. Palindromic Substrings
71.0%
Med.
648. Replace Words
68.1%
Med.
649. Dota2 Senate
48.2%
Med.
657. Robot Return to Origin
76.0%
Easy
664. Strange Printer
61.0%
Hard
676. Implement Magic Dictionary
57.9%
Med.
677. Map Sum Pairs
56.9%
Med.
678. Valid Parenthesis String
38.4%
Med.
680. Valid Palindrome II
42.0%
Easy
681. Next Closest Time
46.8%
Med.
686. Repeated String Match
36.0%
Med.
691. Stickers to Spell Word
49.6%
Hard
692. Top K Frequent Words
58.7%
Med.
696. Count Binary Substrings
65.7%
Easy
709. To Lower Case
83.8%
Easy
712. Minimum ASCII Delete Sum for Two Strings
65.4%
Med.
720. Longest Word in Dictionary
53.0%
Med.
721. Accounts Merge
58.5%
Med.
722. Remove Comments
39.0%
Med.
726. Number of Atoms
65.0%
Hard
727. Minimum Window Subsequence
43.5%
Hard
730. Count Different Palindromic Subsequences
46.0%
Hard
734. Sentence Similarity
44.5%
Easy
736. Parse Lisp Expression
52.1%
Hard
737. Sentence Similarity II
50.4%
Med.
745. Prefix and Suffix Search
41.2%
Hard
748. Shortest Completing Word
60.6%
Easy
751. IP to CIDR
55.8%
Med.
752. Open the Lock
60.5%
Med.
758. Bold Words in String
51.8%
Med.
761. Special Binary String
62.6%
Hard
763. Partition Labels
80.1%
Med.
767. Reorganize String
55.5%
Med.
770. Basic Calculator IV
54.9%
Hard
771. Jewels and Stones
89.0%
Easy
772. Basic Calculator III
51.5%
Hard
777. Swap Adjacent in LR String
37.3%
Med.
784. Letter Case Permutation
74.6%
Med.
791. Custom Sort String
71.4%
Med.
792. Number of Matching Subsequences
50.7%
Med.
796. Rotate String
63.3%
Easy
800. Similar RGB Color
67.7%
Easy
804. Unique Morse Code Words
83.0%
Easy
806. Number of Lines To Write String
69.7%
Easy
809. Expressive Words
46.3%
Med.
811. Subdomain Visit Count
76.6%
Med.
816. Ambiguous Coordinates
56.5%
Med.
819. Most Common Word
44.4%
Easy
820. Short Encoding of Words
60.5%
Med.
821. Shortest Distance to a Character
71.9%
Easy
824. Goat Latin
68.9%
Easy
828. Count Unique Characters of All Substrings of a Given String
52.7%
Hard
830. Positions of Large Groups
52.6%
Easy
831. Masking Personal Information
49.8%
Med.
833. Find And Replace in String
51.7%
Med.
838. Push Dominoes
57.3%
Med.
839. Similar String Groups
55.3%
Hard
842. Split Array into Fibonacci Sequence
39.2%
Med.
843. Guess the Word
38.3%
Hard
844. Backspace String Compare
49.3%
Easy
848. Shifting Letters
44.8%
Med.
854. K-Similar Strings
40.0%
Hard
856. Score of Parentheses
63.9%
Med.
859. Buddy Strings
33.4%
Easy
880. Decoded String at Index
36.5%
Med.
884. Uncommon Words from Two Sentences
75.2%
Easy
890. Find and Replace Pattern
76.8%
Med.
893. Groups of Special-Equivalent Strings
72.4%
Med.
899. Orderly Queue
66.0%
Hard
902. Numbers At Most N Given Digit Set
42.8%
Hard
903. Valid Permutations for DI Sequence
57.0%
Hard
916. Word Subsets
51.6%
Med.
917. Reverse Only Letters
66.0%
Easy
921. Minimum Add to Make Parentheses Valid
74.7%
Med.
925. Long Pressed Name
32.3%
Easy
926. Flip String to Monotone Increasing
61.5%
Med.
929. Unique Email Addresses
67.4%
Easy
936. Stamping The Sequence
62.2%
Hard
937. Reorder Data in Log Files
56.6%
Med.
940. Distinct Subsequences II
43.3%
Hard
942. DI String Match
79.5%
Easy
943. Find the Shortest Superstring
44.3%
Hard
944. Delete Columns to Make Sorted
74.7%
Easy
949. Largest Time for Given Digits
35.4%
Med.
953. Verifying an Alien Dictionary
55.4%
Easy
955. Delete Columns to Make Sorted II
35.3%
Med.
960. Delete Columns to Make Sorted III
58.3%
Hard
966. Vowel Spellchecker
51.4%
Med.
972. Equal Rational Numbers
44.3%
Hard