๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K subscribers
5.59K photos
3 videos
95 files
10.2K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
int n = s.length();
    Map<Character, Integer> f = new HashMap<>();
    for (int i = 0; i < n; i++)
    {
        char chh = s.charAt(i);
        int count = f.getOrDefault(chh, 0);
        f.put(chh, count + 1);
    }

    int m = t.length();
    Map<Character, Integer> f = new HashMap<>();

    for (int i = 0; i < m; i++)
    {
        char chh = t.charAt(i);

        int count = f.getOrDefault(chh, 0);
        f.put(chh, count + 1);
    }

    int result = Integer.MAX_VALUE;

    for (char key : f.keySet())
    {
        int c = freqS.getOrDefault(key, 0);
        int r = f.get(key);

        result = Math.min(result, c / r);
    }

    return result == Integer.MAX_VALUE ? -1 : result;

Amazon SDE1โœ