Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- X EXPECTED RESULT YOUR RESULT
- Success 29 0 0
- Success 4 1 1
- Success -2 -2 -2
- Success 3 1 1
- Success -4 -1 -1
- Success 2 2 2
- Success -95 0 0
- Success -1 -4 -4
- Success 1 4 4
- using System;
- public class Program {
- public static int Puzzle(int x) {
- if (x==1) return 4;
- if (x==-1) return -4;
- if (x<-4 || x>4) return 0;
- if (x<-2) return -1;
- if (x<0) return x;
- if (x>3) return 1;
- return 4-x;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement