This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="container"> | |
<!-- This element's contents will be replaced with your component. --> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
int[] input = {6,5,3,1,8,7,2,4}; | |
int j; | |
for (int i = 1; i < input.length; i++) { | |
// From 1 to n loop with index as i | |
j = i - 1; | |
while (j >= 0) { | |
// From i to 0 with index as j | |
System.out.println(j); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reading from the coding platform for following line | |
// 3 - Test case | |
// 4 1 2 3 4 [4 - Array Length, 1 2 3 4 - Elements in array] | |
// 3 1 1 1 [3 - Array Length, 1 1 1 1 - Elements in array] | |
// 2 1 3 [2 - Array Length, 1 3 - Elements in array] | |
import java.util.Scanner; | |
import java.util.List; | |
import java.util.ArrayList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gym | |
import numpy as np | |
import random | |
import math | |
from time import sleep | |
## Initialize the "Cart-Pole" environment | |
env = gym.make('CartPole-v0') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py | |
$ cd <download location> | |
$ sudo -H ./get-pip.py | |
Use pip to install pip3 | |
$ sudo -H pip install pip3 | |
Installing pip3 also installs Python3 | |
To run Python3 | |
$ python3 |