Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    Practice problems / Is it an anagram?

    Is it an anagram?

    Easystringhash mapcounting

    Two words s and t of lowercase English letters. Return true if t uses exactly the same letters as s in another order (each letter the same number of times).

    Example 1

    Input:  s = "listen", t = "silent"
    Output: true

    Example 2

    Input:  s = "rat", t = "car"
    Output: false

    Constraints

    • 0 ≤ s.length, t.length ≤ 5·10⁴
    • Lowercase English letters only

    Submit checks your solution against 8 tests, including hidden ones.

    /**
     * @param {string} s
     * @param {string} t
     * @return {bool}
     */
    function isAnagram(s, t) {
      
    }
    
    Sign in to run
    SeaCode

    Learn to code for real, online or at our branch in front of Cairo University, Giza.

    Learn

    • All courses
    • Interactive tutorials
    • Interview practice problems
    • Mock interview
    • Learning tracks
    • Code Arena
    • Workshops & Events
    • Knowledge library
    • Team projects

    Your account

    • Log in
    • Sign up
    • Learning plan
    • Certificates
    • Site map

    Contact us

    • WhatsApp
    • 010 9094 1104
    • In front of Cairo University, Giza

    © 2026 SeaCode. All rights reserved.