Search⌘ K
AI Features

Count Anagrams

Count Anagrams asks you to return the number of distinct strings formed by rearranging each word independently while preserving word order, modulo a large prime.

Statement

You are given a string, s, containing one or more words separated by a single space. Your task is ...