This file contains hidden or 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
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Http; | |
class MainContoller extends Controller | |
{ | |
public function login(Request $request) |
This file contains hidden or 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
class Calender | |
attr_accessor :start_time, :end_time | |
def initialize(start_time:, end_time:) | |
@start_time = start_time | |
@end_time = end_time | |
end | |
end | |
def is_overlapping?(c1, c2) |
This file contains hidden or 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
// Problem 1: Move Zeroes | |
function moveZeroToEnd(arr) { | |
const count = {}; | |
const result = []; | |
arr.forEach((element) => { | |
count[element] = (count[element] || 0) + 1; | |
}); |
This file contains hidden or 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
function reformatPolicyNumbers(paragraph) { | |
const policyNumbers = paragraph.split(" "); | |
policyNumbers.map((word, index) => { | |
const policyNumber = word.split("-"); | |
if (policyNumber.length === 3 && !isNaN(Number(policyNumber.join("")))) { | |
policyNumbers[index] = policyNumber.join("/"); | |
} | |
}); |
OlderNewer