Find How Many Subarrays Match The Pattern
Asked at Meta · Coding Questions · Difficulty: Medium
5000 years agooo, in the magical land of Arithma, there existed an enchanted array called numbers, filled with special integers, and a mystical scroll called pattern that held the secret to finding certain relationships among the numbers. The pattern contained only 1, -1, or 0, each symbol representing a unique bond: 1 meant the current number must be greater than the previous one, -1 meant it must be smaller, and 0 indicated equality, like friends standing together unchanged. The council of Arithma sought to discover how many subarrays within numbers matched this magical pattern.
Loading the problem…
More Meta interview questions
- LLM conceptual questions
- Implement a Two-Hidden-Layer MLP with Backpropagation in NumPy
- Dot Product with Run-Length Encoded Vectors
- Count Lakes Wrapped by a Given Island
- Minimum Remove to Make Valid Parentheses
- LLM with Beam Search and Nucleus Sampling (Meta MSL)