Skip to content

Instantly share code, notes, and snippets.

View alwaisy's full-sized avatar

Awais alwaisy alwaisy

View GitHub Profile
@alwaisy
alwaisy / bootstrap-4-modal-fullscreen.markdown
Created September 15, 2022 18:20
Bootstrap 4 Modal Fullscreen

Bootstrap 4 Modal Fullscreen

Responsive Fullscreen Modal Dialogs for Bootstrap 4.

Fullscreen Modals can be enabled only on certain breakpoints. In this way the modal will display "normal" for desktops and fullscreen for mobile devices, giving it the feeling of a native app.

Adapted from: twbs/bootstrap#28683.

A Pen by Andrei Victor Bulearca on CodePen.

// problem
/**
Objective
Today, we're working with binary numbers. Check out the Tutorial tab for learning materials and an instructional video!
Task
Given a base- integer, , convert it to binary (base-). Then find and print the base- integer denoting the maximum number of consecutive 's in 's binary representation. When working with different bases, it is common to show the base as a subscript.
Example
// problem
Objective
Today, we are learning about an algorithmic concept called recursion. Check out the Tutorial tab for learning materials and an instructional video.
Recursive Method for Calculating Factorial
Function Description
Complete the factorial function in the editor below. Be sure to use recursion.
factorial has the following paramter:
// problem
Objective
Today, we're learning about Key-Value pair mappings using a Map or Dictionary data structure. Check out the Tutorial tab for learning materials and an instructional video!
Task
Given names and phone numbers, assemble a phone book that maps friends' names to their respective phone numbers. You will then be given an unknown number of names to query your phone book for. For each queried, print the associated entry from your phone book on a new line in the form name=phoneNumber; if an entry for is not found, print Not found instead.
Note: Your phone book should be a Dictionary/Map/HashMap data structure.
Input Format
// problem
Objective
Today, we will learn about the Array data structure. Check out the Tutorial tab for learning materials and an instructional video.
Task
Given an array, , of integers, print 's elements in reverse order as a single line of space-separated numbers.
Example
Objective
In this challenge, we will use loops to do some math. Check out the Tutorial tab to learn more.
Task
Given an integer, , print its first multiples. Each multiple (where ) should be printed on a new line in the form: n x i = result.
Example
The printout should look like this:
Objective
In this challenge, we're going to learn about the difference between a class and an instance; because this is an Object Oriented concept, it's only enabled in certain languages. Check out the Tutorial tab for learning materials and an instructional video!
Task
Write a Person class with an instance variable, , and a constructor that takes an integer, , as a parameter. The constructor must assign to after confirming the argument passed as is not negative; if a negative argument is passed as , the constructor should set to and print Age is not valid, setting age to 0.. In addition, you must write the following instance methods:
yearPasses() should increase the instance variable by .
amIOld() should perform the following conditional actions:
If , print You are young..
If and , print You are a teenager..
// question
Task
Given an integer, , perform the following conditional actions:
If is odd, print Weird
If is even and in the inclusive range of to , print Not Weird
If is even and in the inclusive range of to , print Weird
If is even and greater than , print Not Weird
Complete the stub code provided in your editor to print whether or not is weird.
// all test 0 => failed, test [1,2,3] => passed
'use strict';
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
@alwaisy
alwaisy / hacker-rank-30days-1.js
Last active June 17, 2022 17:34
hacker rank day2
=> testcase-0 => success
test-case-1 => failed
process.stdin.resume();
process.stdin.setEncoding('ascii');
var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;