Skip to content

Instantly share code, notes, and snippets.

View Ram-1234's full-sized avatar
🔍
looking for job change

Ramnayan yadav Ram-1234

🔍
looking for job change
View GitHub Profile
@Ram-1234
Ram-1234 / half pyramid with palindrome number code using c++
Created March 1, 2021 17:58
Half Pyramid With Polindrome Number
#include<iostream>
using namespace std;
int main(){
int i,j,k,l,range;
cout<<"Enter Size of Range: ";
cin>>range;
cout<<"Range: "<<range<<endl;
for(i=1;i<=range;i++){
for(j=1;j<=range-i;j++){
cout<<" "; //spacing
@Ram-1234
Ram-1234 / full pyramid with palindrome number c++ code
Created March 1, 2021 18:21
Full Pyramid With Palindrome Number
#include<iostream>
using namespace std;
int main(){
int i,j,k,l,range;
cout<<"Enter Size of Range: ";
cin>>range;
cout<<"Range: "<<range<<endl;
//first half code
for(i=1;i<=range;i++){
for(j=1;j<=range-i;j++){
@Ram-1234
Ram-1234 / Leet Code Spiral Matrix II Solution in Java
Created March 3, 2021 03:25
Leet Code Spiral Matrix II Problem and Solution
class Solution {
public int[][] generateMatrix(int n) {
//int k=0;
// int m=mat.length;
//int n=mat[0].length;
int num=1;
int mat[][]=new int[n][n];
@Ram-1234
Ram-1234 / Fibonacci series code in java
Created March 4, 2021 03:44
Fibonacci Series Using Loop
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main (String[] args) throws java.lang.Exception
@Ram-1234
Ram-1234 / fibonacci series java ode
Created March 4, 2021 04:03
Fibonacci Series Using Recursion
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
Problem Description:-
There are N buildings in a row with different heights(H[i]).
You are viewing the buildings from the left and can see the roof of a building, if no building to the left of that building has height greater than equal to height of that building.
You are asked the number of buildings whose roofs you can see.
Input:-
The first line contains N denoting number of buildings.
The next line contains N space seperated integers denoting heights of the buildings from left to right.
Problem Description:-
There are N buildings in a row with different heights(H[i]).
You are viewing the buildings from the left and can see the roof of a building, if no building to the left of that building has height greater than equal to height of that building.
You are asked the number of buildings whose roofs you can see.
Input:-
The first line contains N denoting number of buildings.
The next line contains N space seperated integers denoting heights of the buildings from left to right.
@Ram-1234
Ram-1234 / fibonacci java code in dp
Created March 8, 2021 05:25
Fibonacci Using Dynamic Programming Concept
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void fib(int n){
@Ram-1234
Ram-1234 / fibonacci java code using recursion dp
Created March 8, 2021 06:19
Fibonacci Series Using Recursion
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main (String[] args) throws java.lang.Exception