Bot Problem.How to solve this problem in c?

-9

Programming problem: In BotLand, Robots can understand all words of any combination of letters and letters with leading or trailing (not both) numeric value. Given a word W (string of alphanumeric). Write a function to check if W is Bot word. Don't use library functions/ regex.

Example:

Input: BotLand
Output: Bot word

Input: BotLand77
Output: Bot word

Input: 1Bot2Land3
Output: Non Bot word

Mafuj Shikder

Posted 2019-08-26T12:58:59.860

Reputation: 1

Question was closed 2019-08-26T14:07:02.917

6

Welcome to CGCC. This site hosts recreational programming challenges, based on an objective winning criterion. (Here, you picked code-golf: the shortest answer wins.) It is not designed to get any practical implementation or theoretical answer. So, is it really supposed to be a challenge?

– Arnauld – 2019-08-26T13:37:32.753

Answers

3

Python 3, 33 bytes

lambda s:1-(s[0]+s[-1]).isdigit()

Try it online!

-8 bytes thanks to Grimy and A _

Jitse

Posted 2019-08-26T12:58:59.860

Reputation: 3 566

Python 3, 41 bytes lambda s:a(s[0])+a(s[-1])>0 a=str.isalpha what is this @Jitse. what is this? – Mafuj Shikder – 2019-08-26T13:07:45.800

1@MafujShikder it's a program answering your challenge. You can use the Try it online! link to check that it works. – Grimmy – 2019-08-26T13:09:53.367

136 bytes – Grimmy – 2019-08-26T13:10:11.197

@Jitse please solve this problem n c – Mafuj Shikder – 2019-08-26T13:18:40.080

233B if you use 1 for true and 0 for false. 32B by abusing predefined true/false values even further. – None – 2019-08-26T13:36:19.400

@MafujShikder Specific-language competitions are highly discouraged unless in very specific cases and this is not one of those cases. – MilkyWay90 – 2019-08-26T16:20:51.000