Skip to content

Instantly share code, notes, and snippets.

@kwangshin
kwangshin / TwoRectanglesArea.java
Created September 17, 2015 14:41
Get the sum of area of two rectangles.
/**
* Created by Kwangshin on 2015-09-17.
* Email : kwangshin@gmail.com
*/
public class TwoRectanglesArea {
public int getAreaOfTwoRectangles(int K, int L, int M, int N, int P, int Q, int R, int S) {
// Get the sum of area of two rectangles separately, i.e., no concern about the overlapped area.
long twoRectanglesAreaSeparately = this.getTwoRectanglesAreaSeparately(K, L, M, N, P, Q, R, S);
// Overlapping area right is the smaller value in two rectangles right values.
@bMinaise
bMinaise / bs3-login-form.html
Created November 6, 2013 02:20
Bootstrap 3 - Login Form Example From: http://bootsnipp.com
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
<h1 class="text-center login-title">Sign in to continue to Bootsnipp</h1>
<div class="account-wall">
<img class="profile-img" src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=120"
alt="">
<form class="form-signin">
<input type="text" class="form-control" placeholder="Email" required autofocus>
<input type="password" class="form-control" placeholder="Password" required>
@hkarthik
hkarthik / gist:2699002
Created May 15, 2012 03:53
Codility Demo test in Java
class Solution {
public int equi ( int[] A ) {
int result = -1;
for(int i = 0; i < A.length; i++) {
if (lowerBound(A,i) == upperBound(A,i)) {
result = i;
break;
}
}
@mourner
mourner / codility-demo.js
Created January 7, 2012 09:49
Codility demo tests solutions
// 100-score solution for http://codility.com/demo/take-sample-test/
function equi(array) {
var i,
len = array.length,
sum = 0,
leftSum = 0,
rightSum;
for (i = 0; i < len; i++) {