Bài đăng

Hiển thị các bài đăng có nhãn leetcode

Leetcode

 Try hard Java on hackerrank Day1: Wellcome 2 java public class Solution {     public static void main ( String [] args ){         System . out . println ( "Hello, World." );         System . out . println ( "Hello, Java." );     } } Day2: java stdin and stdout import java.util.Scanner ; public class Solution {     public static void main ( String [] args ){         Scanner input = new Scanner ( System . in );         int number1 = input . nextInt ();         int number2 = input . nextInt ();         int number3 = input . nextInt ();         System . out . println (number1);         System . out . println (number2);         System . out . println (number3);     } } Day3: java if else import java.util.Scanner ; public class Solution { ...
 LeetCode, It's coding time LeetCode day1: Long common prefix. Level easy Python solution class Solution :     def longestCommonPrefix ( self , strs : List[ str ]) -> str :         if not str :             return ""         strs.sort()         first_list = strs[ 0 ]         last_list = strs[- 1 ]         long_common_prefix = ""         for i in range ( len (first_list)):             if first_list[i] == last_list[i]:                 long_common_prefix+=first_list[i]             else :                 return long_common_prefix         return long_common_prefix Javascript solution /**  * @param {string[]} strs  * @return {string}  */ var l...