MCPcopy Create free account
hub / github.com/VanjaRo/LeetCode / value

Function value

tasks/125.go:31–42  ·  view source on GitHub ↗
(m byte)

Source from the content-addressed store, hash-verified

29}
30
31func value(m byte) int {
32 if m >= '0' && m <= '9' {
33 return int((m - '0') + 100)
34 }
35 if m >= 'A' && m <= 'Z' {
36 return int(m - 'A')
37 }
38 if m >= 'a' && m <= 'z' {
39 return int(m - 'a')
40 }
41 return -1
42}
43
44// Same func but with usage of regexp and strings modules
45

Callers 1

isPalindromeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected