Q2. Valid Anagram | Leetcode 242 | Array questions for Frontend Interview | DSA in Javascript

Поділитися
Вставка
  • Опубліковано 14 жов 2024

КОМЕНТАРІ • 9

  • @samruddhisam1636
    @samruddhisam1636 Рік тому

    yestersay onward i started to watch ur videos....im started interview preparation

  • @hrithikrudra4292
    @hrithikrudra4292 Рік тому

    Thanks for sharing..Your content are awesome ..Please create a whole DSA playlist covering all the topics

  • @venkateshpachigulla
    @venkateshpachigulla Рік тому

    Try objects if don't know about maps much

  • @santoshmore2953
    @santoshmore2953 Рік тому

    being fresher how many projects should i add to my frontend profile?

  • @mohanchowdary7288
    @mohanchowdary7288 Рік тому

    Thanks for sharing

  • @x..darkfate..x
    @x..darkfate..x Рік тому

    great share

  • @myworld8837
    @myworld8837 9 місяців тому

    line 15 only it should have been working

  • @akash_gupta_2090
    @akash_gupta_2090 Рік тому

    var isAnagram = function(s, t) {
    let s1 = {};
    let t1 = {};
    if(Object.keys(s).length !== Object.keys(t).length) return false
    function calculateCount(str,st) {
    if(st =="s1") {
    for(let check of str) {
    s1[check] = (s1[check] || 0) + 1
    }
    } else if(st =="t1") {
    for(let check of str) {
    t1[check] = (t1[check] || 0) + 1
    }
    }
    }
    calculateCount(s,"s1")
    calculateCount(t,"t1")
    for(let index in s1) {
    if(s1[index] != t1[index]) {
    return false
    }
    }
    return true
    };

  • @venkateshpachigulla
    @venkateshpachigulla Рік тому

    Try objects if don't know about maps much