6 views
24 Jan 2026
Read one token. Decide its data type using simple rules: True/False is BOOL, signed digits is INT, number with dot is FLOAT, otherwise STRING. Output the type name....
3 views
24 Jan 2026
A number is provided as a string x and an integer y is provided. Convert x to int and output x+y....
2 views
24 Jan 2026
A decimal number x is provided. Round it to nearest integer (0.5 goes away from zero) and output the integer....
2 views
24 Jan 2026
One character ch is provided. Output its ASCII/Unicode code using ord()....
2 views
24 Jan 2026
Input has one integer code is provided (0 to 127). Output the character using chr()....
2 views
24 Jan 2026
Word w and integer n are provided. Output w repeated n times, joined with '-' (dash). If n is 0 output empty....
2 views
24 Jan 2026
Read integer b (0 or 1), flip it (0 becomes 1 and 1 becomes 0). Output flipped value....
3 views
24 Jan 2026
String s is provided (no spaces). Output YES if all characters are digits, else NO....
2 views
24 Jan 2026
Three words are provided: first, middle, last. Output initials like R.K.S (with dots)....
3 views
24 Jan 2026
Input has two integers a and b are provided (b is not 0). Output a/b with exactly 4 digits after decimal....
4 views
24 Jan 2026
Read n tokens. Each token can be: signed int, float (with dot), True/False, NONE, or a word. Count how many INT, FLOAT, BOOL, NONE, and WORD tokens and output counts in this order....
4 views
24 Jan 2026
Read n values, each value is either integer or float (contains dot). Sum them and output result with exactly 3 decimals....
2 views
24 Jan 2026
Input has one integer n is provided (can be very large). Output how many bits are needed to represent |n| in binary. For n=0 output 1....
3 views
24 Jan 2026
Read two floats a and b. If |a-b| < 1e-9 output EQUAL. Else output GREATER if a>b else SMALLER....
3 views
24 Jan 2026
Hex string h is provided (without 0x). Convert it to decimal integer and output it....
3 views
24 Jan 2026
Read one integer n. Output its lowercase hexadecimal representation without 0x....
3 views
24 Jan 2026
Two binary strings a and b are provided (same length). Compute bitwise XOR and output result without leading zeros (output 0 if all zero)....
3 views
24 Jan 2026
Read a b c d, treat them as complex numbers (a+bi) and (c+di). Multiply them and output real and imag parts....
2 views
24 Jan 2026
A line string s is provided (can contain spaces). Convert it to UTF-8 bytes. Output two integers: byteLength and checksum (sum of bytes modulo 256)....
2 views
24 Jan 2026
Read n tokens. If token is a valid signed integer, add it to sum. Otherwise ignore it. Output the sum....
3 views
24 Jan 2026
Amount is provided as string like 12, 12.3, 12.345. Output it in money format with 2 decimals using normal rounding (half up)....
2 views
24 Jan 2026
A string s is provided. If it starts and ends with double quote, remove those two quotes. Otherwise output as it is....
2 views
24 Jan 2026
Input is a single token t is provided. If t is True output 1, if False output 0, if NONE output NULL. Otherwise output t unchanged....
3 views
24 Jan 2026
A number is provided as a string, it may be in scientific notation like 1e3 or 2.50E-1. Output it as normal decimal without exponent and remove extra trailing zeros....
4 views
24 Jan 2026
Read n tokens, find the first adjacent pair (i,i+1) which have different inferred type using rules: BOOL, INT, FLOAT, WORD. Output i (1-based) or -1 if all adjacent types are same....
2 views
24 Jan 2026
A number is provided as string. It may have + sign, leading zeros, and decimal part. Normalize it: remove +, remove extra leading zeros, remove trailing zeros in decimal, and if it becomes -0 or 0.0 t...
3 views
24 Jan 2026
Read n tokens. Each token can be decimal like 15, binary like 0b1010, octal like 0o12, or hex like 0xFF. Tokens can also have a leading '-' sign. Convert all to integer and output the sum....
3 views
24 Jan 2026
Two fractions are provided as p/q form. Add them and output result in reduced form p/q with q positive....
3 views
24 Jan 2026
A quoted string is provided. It can contain escapes: \\\\n, \\\\t, \\\\\\\\, and \\\\\. Unescape it and output two integers: length and checksum (sum of char codes modulo 256)."....
3 views
24 Jan 2026
A JSON array is provided in one line, like [1,2,true,null]. Count how many numbers, strings, booleans, and null values. Output counts in order: num str bool null....
3 views
24 Jan 2026
Read n and then n integers (0..255). Put them into a bytes object and output hex string in uppercase....
2 views
24 Jan 2026
Read n values (each is int or float with dot). If all are integers, output PRODUCT as integer. Otherwise output SUM as float with 2 decimals....
2 views
24 Jan 2026
Two complex numbers are provided as a b and c d (a+bi and c+di). Output FIRST if first magnitude is bigger, SECOND if second bigger, else EQUAL....
2 views
24 Jan 2026
Read x and n. Repeat n times: x = round(x,2) + 0.1 (decimal rounding half up). Output final x with exactly 2 decimals....
2 views
24 Jan 2026
Read n tokens. Token types: INT, FLOAT (with dot), WORD. Sort by type order INT then FLOAT then WORD. For ints sort by numeric value, for floats sort by numeric value, for words sort lexicographically...