Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion HelloWorld.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class HelloWorld {
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
Expand Down
9 changes: 9 additions & 0 deletions HelloWorldUsingMethod.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
public class HelloWorldUsingMethod {
static void hello_world(){
System.out.println("Hello World");
}

public static void main(String[] args) {
hello_world();
}
}
11 changes: 11 additions & 0 deletions Programming_basics.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
11 changes: 0 additions & 11 deletions hello_world.java

This file was deleted.

33 changes: 33 additions & 0 deletions out/production/Programming_basics/.github/workflows/blank.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!

# Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.
3 changes: 3 additions & 0 deletions out/production/Programming_basics/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions out/production/Programming_basics/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions out/production/Programming_basics/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions out/production/Programming_basics/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added out/production/Programming_basics/HelloWorld.class
Binary file not shown.
Binary file not shown.
49 changes: 49 additions & 0 deletions out/production/Programming_basics/HourGlass_Challenge
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//HourGlass_Challenge solution in java language

import java.util.Scanner;

class hourGlass_Challenge{

static int findMaxSum(int [][]mat, int n)
{
int row = n;
int column = n;
if (row < 3 || column < 3)
return -1;

int maxSum = Integer.MIN_VALUE;
for (int i = 0; i < row - 2; i++)
{
for (int j = 0; j < column - 2; j++)
{
int sum = (mat[i][j] + mat[i][j + 1] +
mat[i][j + 2]) + (mat[i + 1][j + 1]) +
(mat[i + 2][j] + mat[i + 2][j + 1] +
mat[i + 2][j + 2]);

maxSum = Math.max(maxSum, sum);
}
}
return maxSum;
}

static public void main (String[] args)
{
Scanner s = new Scanner(System.in);
int input = s.nextInt();
int [][]mat = new int[n][n]
for(int i = 0; i< n; i++){
for(int j = 0; j< n; j++){
mat[i][j] = s.nextInt();
}
}

int res = findMaxSum(mat, input);
if (res == -1)
System.out.println("Not possible");
else
System.out.println("Maximum sum of hour glass = "
+ res);
}

}
21 changes: 21 additions & 0 deletions out/production/Programming_basics/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Ayush Das

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 11 additions & 0 deletions out/production/Programming_basics/Programming_basics.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
7 changes: 7 additions & 0 deletions out/production/Programming_basics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Programming_basics
# code in java to print hello_world
public class Hello_world {
public static void main(String [] args) {
System.out.println("Hello_world");

}}
50 changes: 50 additions & 0 deletions out/production/Programming_basics/hourglass_challenge_java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// C++ program to find maximum sum of hour
// glass in matrix
#include<bits/stdc++.h>
using namespace std;
const int R = 5;
const int C = 5;

// Returns maximum sum of hour glass in ar[][]
int findMaxSum(int mat[R][C])
{
if (R<3 || C<3)
return -1;

// Here loop runs (R-2)*(C-2) times considering
// different top left cells of hour glasses.
int max_sum = INT_MIN;
for (int i=0; i<R-2; i++)
{
for (int j=0; j<C-2; j++)
{
// Considering mat[i][j] as top left cell of
// hour glass.
int sum = (mat[i][j]+mat[i][j+1]+mat[i][j+2])+
(mat[i+1][j+1])+
(mat[i+2][j]+mat[i+2][j+1]+mat[i+2][j+2]);

// If previous sum is less then current sum then
// update new sum in max_sum
max_sum = max(max_sum, sum);
}
}
return max_sum;
}

// Driver code
int main()
{
int mat[][C] = {{1, 2, 3, 0, 0},
{0, 0, 0, 0, 0},
{2, 1, 4, 0, 0},
{0, 0, 0, 0, 0},
{1, 1, 0, 1, 0}};
int res = findMaxSum(mat);
if (res == -1)
cout << "Not possible" << endl;
else
cout << "Maximum sum of hour glass = "
<< res << endl;
return 0;
}