Parse Farm Sensor Reading Code
Parse Farm Sensor Reading Code
EasyStrings0% accepted
A farmer in Punjab uses IoT sensor codes like 'SOIL-45-MOISTURE-60-TEMP-28' to monitor crop health. He needs to extract valid sensor names from this coded string.
Approach
Extract sensor names from a hyphen-separated code string in format 'SENSORTYPE-VALUE-SENSORTYPE-VALUE...' and validate against allowed types.
Input
SOIL-45-MOISTURE-60-TEMP-28
Output
true
More Strings problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards