leetle

Daily challenge for 2025-05-14

134. In the Ocean

Write a function solve that checks if a given string is a valid oceanic coordinate. The coordinate is valid if it follows the format of a cardinal direction followed by a degree value, and it must be within the valid ranges for both latitude and longitude, which are between 0 and 90 degrees for latitude and 0 and 180 degrees for longitude.

Example:
Input: "N45E90"
Output: true
Explanation: North 45 degrees, East 90 degrees.

Run this challenge interactively in Python or JavaScript when the app loads.