Skip to content

Instantly share code, notes, and snippets.

View LarrySul's full-sized avatar
🎯
Focusing

Sule-Balogun Olanrewaju LarrySul

🎯
Focusing
View GitHub Profile
@LarrySul
LarrySul / max_values.php
Last active September 9, 2021 08:27
find the maximum value in a series of nested arrays
<?php
function findMaxValues (array $values) :int
{
if(!is_array($values)) return "not an array";
$max_val = 0;
@LarrySul
LarrySul / reverse_string.php
Last active September 8, 2021 13:19
Write a function that can be used to reverse a string in php
<?php
function reverse_string($str) : string
{
if(!is_string($str)) return "not a string";
$lengthString = strlen($str);
$data = [];
@LarrySul
LarrySul / Larry Soln
Last active May 6, 2021 09:04
Given a binary array nums, return the maximum number of consecutive 1's in the array.
class Solution {
function findMaxConsecutiveOnes($nums) {
$count = 0;
$consecutiveOnes = 0;
foreach($nums as $num){
if($num == 1){
$count +=1;
$consecutiveOnes = max($count, $consecutiveOnes);
}else{
@LarrySul
LarrySul / SeamlessHR technical test
Last active July 23, 2020 15:49
write a function to find and replace element in an array
<?php
$banks =
[
'United Bank For Africa' => 'UNITED BANK FOR AFRICA PLC',
'Access Bank Plc' => 'ACCESS BANK PLC',
'Gtb' => 'GUARANTY TRUST BANK PLC',
'Firstbank Nigeria plc' => 'FIRST BANK OF NIGERIA PLC'
];
@LarrySul
LarrySul / README.md
Last active September 10, 2019 22:32 — forked from tillkruss/README.md
Junior developer code challenge for Mercatus

Mercatus code challenge

Hi there!

Please write thorough and human-readable tests for the WaitlistController.php.

  • You can use unit, feature and/or browser tests
  • Cover corner-cases / regressions
  • The tests don't actually need run
<Btn
highlight={this.state.highlight}
onToggle={this.toggleBtn}
/>
$('btn').click(() => {
$(this).toggleClass('highlight')
$(this).text() === 'Add Highlight'
? $(this).text('Remove Highlight')
: $(this).text('Add Highlight')
})
<input
type="month"
value="2019-07"
/>
<!-- you need to give a default value of year - month as shown above -->
<input
type="week"
value="2019-W2"
/>
<input
type="color"
value="#ffffff"
/>