diff --git "a/leetcode2/1easy/\354\265\234\354\233\220\354\244\200/Q2748.java" "b/leetcode2/1easy/\354\265\234\354\233\220\354\244\200/Q2748.java" new file mode 100644 index 00000000..66b4d65f --- /dev/null +++ "b/leetcode2/1easy/\354\265\234\354\233\220\354\244\200/Q2748.java" @@ -0,0 +1,47 @@ +package Leetcode.최원준; + +/* +1. 아이디어 : + + +2. 시간복잡도 : +O( ) + +3. 자료구조/알고리즘 : + + */ + +public class Q2748 { + class Solution { + public int gcd(int a, int b) { + if (b!=0) return gcd(b, a%b); + return a; + } + + public int getFirstDigit(int num) { + while (num >= 10) num /= 10; + return num; + } + + public int getLastDigit(int num) { + return num % 10; + } + + public int countBeautifulPairs(int[] nums) { + int ans = 0; + int n = nums.length; + int[][] digits = new int[n][n]; + for (int i=0; i distincts = new HashSet<>(); + for (char c : key.toCharArray()) { + distincts.add(c); + if (distincts.size() > maxLetters) return false; + } + return true; + } + public int maxFreq(String s, int maxLetters, int minSize, int maxSize) { + int n = s.length(); + Map counter = new HashMap<>(); + + StringBuilder sb = new StringBuilder(); + for (int i=0; i