In this Leetcode Indent, Ruby problem solution Write your program in Ruby which takes an un-indented Ruby code as a string and outputs the indented Ruby code as a string.

HackerEarth Indent Ruby problem solution

HackerEarth Indent Ruby problem solution.

import java.util.Scanner;

class TestClass {

public static void main(String args[] ) throws Exception {

Scanner sc=new Scanner(;


System.out.println("class YabbaDabbaDoo\n def foo \n if foo == 42 \n puts 'world hello' \n elsif foo == 24 \n puts 'bk201' \n else \n puts 'congrats!'");

System.out.println(" end");

System.out.println(" end");