Friday, January 1, 2021

Covariant Return Types | Advanced Java | HackerRank | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-covariance/problem

Solution :

Java Singleton Pattern | Advanced Java | OOP Patterns | HackerRank | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-singleton/problem

Solution : 

Java Factory Pattern | Advanced Java | OOP Patterns | HackerRank | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-factory/problem

Solution : 

Java Reflection - Attributes | Advanced Java | HackerRank | Practice | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-reflection-attributes/problem

Solution :

Java Varargs - Simple Addition | Advanced Java | HackerRank | Practice | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/simple-addition-varargs/problem

Solution : 

Java Exception Handling | Exception Handling | HackerRank | Java | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-exception-handling/problem

Solution :

Java Exception Handling (Try-catch) | Exception Handling | HackerRank | Java | Practice | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-exception-handling-try-catch/problem

Solution :

Java Iterator | OOP | HackerRank | Java | Practice | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-iterator/problem

Solution :

Java Instanceof keyword | OOP | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-instanceof-keyword/problem

Solution :

Java Method Overriding 2 (Super Keyword) | OOP | HackerRank | Practice | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-method-overriding-2-super-keyword/problem

Solution : 

Java Method Overriding | OOP | HackerRank | Java | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-method-overriding/problem

Solution :

Java Interface | OOP | HackerRank | Java | Solution | Practice | Color The Code



Problem : https://www.hackerrank.com/challenges/java-interface/problem

Solution :

Java Abstract Class | OOP | HackerRank | Java | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-abstract-class/problem

Solution : 

Java Inheritance II | OOP | HackerRank | Java | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-inheritance-2/problem

Solution :

Java Inheritance I | OOP | HackerRank | Java | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-inheritance-1/problem

Solution :

Java BitSet | Data Structure | HackerRank | Practice | Java | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-bitset/problem

Solution : 

Java Sort | Data Structure | HackerRank | Java | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-sort/problem

Solution :

Java Generics | Data Structure | HackerRank | Java | Practice | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-generics/problem

Solution : 

Java Hashset | Data Structure | HackerRank | Java | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-hashset/problem

Solution : 

Java Map | Data Structure | Java | HackerRank | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/phone-book/problem

Solution : 

Java List | Data Structure | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-list/problem

Solution :

Java Arraylist | Data Structure | HackerRank | JAVA | Solution | Color The Code



Problem  : https://www.hackerrank.com/challenges/java-arraylist/problem

Solution :

Java Subarray | Data Structure | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-negative-subarray/problem

Solution :

Java 2D Array | Data Structure | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-2d-array/problem

Solution : 

Java 1D Array | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-1d-array-introduction/problem

Solution :

Java BigInteger | Bignumber | JAVA | HackerRank | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-biginteger/problem

Solution : 

Java Primality Test | Big Number | HackerRank | Java | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-primality-test/problem

Solution :

Valid Username Regular Expression | String | HackerRank | Solution | color the code



Problem : https://www.hackerrank.com/challenges/valid-username-checker/problem

Solution : 

Pattern Syntax Checker | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/pattern-syntax-checker/problem

Solution : 

Java String Tokens | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-string-tokens/problem

Solution : 

Java Anagrams | HackerRank | Java | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-anagrams/problem

Solution :

Java String Reverse | HackerRank | JAVA | Solution | color the code



Problem : https://www.hackerrank.com/challenges/java-string-reverse/problem

Solution :

Java Substring Comparisons | HackerRank | JAVA | Solution | color the code



Problem : https://www.hackerrank.com/challenges/java-string-compare/problem

Solution : 

Java Substring | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-substring/problem

Solution : 

Java Strings Introduction | HackerRank | JAVA | Solution | color the code



Problem : https://www.hackerrank.com/challenges/java-strings-introduction/problem

Solution :    

Java Currency Formatter | JAVA | HackerRank | Solution | color the code



Problem : https://www.hackerrank.com/challenges/java-currency-formatter/problem

Solution : 

Java Date and Time | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-date-and-time/problem

Solution : 

Java Int to String | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-int-to-string

Solution : 

Java Static Initializer Block | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-static-initializer-block/problem

Solution : 

Java End-of-file | HackerRank | JAVA | Solution



Problem : https://www.hackerrank.com/challenges/java-end-of-file/problem

Solution :

Java Datatypes | HackerRank | Java | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-datatypes/problem

Solution : 

Java Loops II | HackerRank | JAVA | Solution



Problem : https://www.hackerrank.com/challenges/java-loops/problem

Solution :

Java Loops I | HackerRank | JAVA | Solution



Problem : https://www.hackerrank.com/challenges/java-loops-i/problem

Solution :

Java Output Formatting | HackerRank | JAVA | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/java-output-formatting/problem

Solution :

Java Stdin and Stdout II | HackerRank | Java | Solution | code the color



Problem : https://www.hackerrank.com/challenges/java-stdin-stdout/problem

Solution :

Overload Operators | HackerRank | C++ | Solution



Problem : https://www.hackerrank.com/challenges/overload-operators/problem

Solution : 

Preprocessor Solution | HackerRank | C++ | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/preprocessor-solution/problem

Solution : 

C++ Class Templates | HackerRank | C++ | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/c-class-templates/problem

Solution : 

Multi Level Inheritance | HackerRank | C++ | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/multi-level-inheritance-cpp/problem

Solution :


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

class Triangle{
    public:
        void triangle(){
            cout<<"I am a triangle\n";
        }
};

class Isosceles : public Triangle{
      public:
          void isosceles(){
            cout<<"I am an isosceles triangle\n";
          }
};

//Write your code here.
class Equilateral : public Isosceles{
public:
void equilateral(){
    cout<<"I am an equilateral triangle\n";
}
}; 

int main(){
  
    Equilateral eqr;
    eqr.equilateral();
    eqr.isosceles();
    eqr.triangle();
    return 0;
}

Rectangle Area | HackerRank | C++ | Solution | Color The Code



Problem : https://www.hackerrank.com/challenges/rectangle-area/problem

Solution : 

class Rectangle{

    public:

    int width;

    int height;

    void display(){

        cout<<width<<" "<<height<<endl;

    }

};

class RectangleArea : public Rectangle{

    public:

    void read_input(){

        cin>>width>>height;

    }

    void display(){

        cout<<(width*height);

    }

};