Tintucgame - Tin Trò Chơi & Giải Trí Cập Nhật Hàng Ngày
  • Home
  • Liên Minh Huyền Thoại
  • Game
  • Công Nghệ
No Result
View All Result
  • Home
  • Liên Minh Huyền Thoại
  • Game
  • Công Nghệ
No Result
View All Result
Tintucgame - Tin Trò Chơi & Giải Trí Cập Nhật Hàng Ngày
No Result
View All Result
Home Giải Trí

Make Array Consecutive 2 | CodeFights Intro Algorithm JavaScript Solution and Breakdown

admin by admin
April 24, 2020
in Giải Trí
10
Make Array Consecutive 2 | CodeFights Intro Algorithm JavaScript Solution and Breakdown
0
SHARES
5
VIEWS
Share on FacebookShare on Twitter



Make Array Consecutive 2 | CodeFights Intro Algorithm JavaScript Solution and Breakdown
Support our Community:
-Donate:
-Patreon:
-Code, Tech and Caffeine Facebook Group:
-Discord:
– Looking for a a Bootcamp check out DevMountain’s program where housing is included with the tuition:

Tutoring, Mentoring and Course Walkthroughs available:

Thank you to my Patreon Supporters Below:
-Check out youtube.com/user/cardinalslinkyband

Support me and visit my store at:

Internship, Part-Time, & Full time work for college students and recent grads:

Fan funding goes towards buying the equipment necessary to deliver 4k videos, 4k webcam, and a high quality microphone better audio. Any support is very appreciated!

My channel is here for aspiring programmers to learn easier and help debug any issues from the many great free resources available on the web.

Check out my other videos going over HTML, CSS, Ruby, Ruby on Rails, Java, JavaScript, Python, PHP, SQL, Command Line, BootStrap, jQuery, and WordPress from CodeCademy, CodeCombat, FreeCodecamp and more!

-~-~~-~~~-~~-~-
Please watch: “How I Became a Developer | My Developer Journey of the Last 3 Years | Ask a Dev”

-~-~~-~~~-~~-~-

Nguồn: https://tintucgame.net

Xem thêm bài viết khác: https://tintucgame.net/giai-tri/

Xem thêm Bài Viết:

  • Ad Copy for PPC Crash Course Video from the Trada PPC Library
  • [Hướng dẫn] Chạy QUẢNG CÁO FACEBOOK TIN NHẮN (messenger ads) – Siêu dễ Siêu cơ bản
  • Legal Hot Topics_Nov 2018-Federal Security Clearance Adjudication
  • RESET EPSON L380 , L383, L385, L485 ADJUSTMENT PROGRAM FULL VERSION FREE DOWNLOAD
  • #Traveller1 – 3e Urban life – 1.VOCABULARY – ADJECTIVES DESCRIBING PLACES – B. Use some of the adj..
Previous Post

Tử vi hàng ngày THỨ 5 ngày 25/4/2019 của 12 con giáp về sự nghiệp, tình duyên, tài lộc P1

Next Post

Liên quân mobile Top 5 lý do khiến Rank cao thủ luôn là ước mơ | Bí kip leo rank cao thủ mùa 6

admin

admin

Next Post
Liên quân mobile Top 5 lý do khiến Rank cao thủ luôn là ước mơ | Bí kip leo rank cao thủ mùa 6

Liên quân mobile Top 5 lý do khiến Rank cao thủ luôn là ước mơ | Bí kip leo rank cao thủ mùa 6

Comments 10

  1. William Violette says:
    3 years ago

    can you solve without a for loop? I try to avoid use for loops in my code though haven't been successful with forEach()

    Reply
  2. TDTheTruth says:
    3 years ago

    Really interesting, I succeeded but with some whack if statement that looks mess!

    Reply
  3. Taylor Griffin says:
    3 years ago

    what is the point of doing `statues.sort((a,b)=> {
    return a – b;
    });`? if .sort() automatically puts it in numeric order?

    Reply
  4. Christian Rodier says:
    3 years ago

    Beautiful coding!

    Reply
  5. drip drop says:
    3 years ago

    there is no need to sort the array like this, or index it, at all. anyone who does so has no idea what they're doing, especially if they don't >sort(compare)< them with >>statues.sort(function(a, b){return a > b})<< instead of the (a,b=>[a+-b]) bullshit all these bozos do. or at least explain to people why an empty sort wouldn't work if any of the numbers were over "9". why make tutorials if you don't know what you're doing? this isn't educational, it's a waste of time and should be in the entertainment or comedy section. I've watched several of your videos and not a single one would be helpful to anyone, at all. At most, other people who don't know what they're doing wither can get the answer here, but for those who really are looking for help understanding, this makes less than no sense and will confuse them more because nothing is explained and the things done don't even make sense. It's pretty clear this guy just got these answers somewhere else, because no sane person who knows what they're doing would do them these ways shown in his videos. Same goes for a few of the other shitbags making these videos. I did not fought in Iraq for 4 years just so I could come home to this. I'm a Navy Seal and I have several medals. Do you know what I'd do to you? Stop making these videos or else. I’ll have you know I graduated top of my class, and I’ve been involved in numerous secret raids on Al-Quaeda, and I have over 300 confirmed kills. I am trained in gorilla warfare and I’m the top sniper in the entire US armed forces. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words. You think you can get away with making terrible tutorials over the Internet? Think again, fucker.

    Reply
  6. Franz Jacob Hernandez says:
    3 years ago

    This doesn't work for their hidden tests. You'll succeed upon hitting "run tests", but will get a 9/10 and fail once you try to submit

    Reply
  7. Topsoil Depletion Awareness (closing the loop) says:
    3 years ago

    I think this works (I am not sure because I didnt read all the problem):

    let arr = [6,2,3,8];

    function missingNums(arr) {
    let newArr = [];
    for (let i = Math.min(…arr); i <= Math.max(…arr); i++) {
    newArr.push(i);
    }
    return newArr.filter(n => !arr.includes(n));
    }

    console.log(missingNums(arr));

    Reply
  8. Dev Material says:
    3 years ago

    My solution was quite different. instead of having a min and max, I looped through the array with var i = 1 and compared statues[i] – statues[i-1] to 1. If the number of statues[i] – statues[i-1] was !== to 1, I would take that number, subtract it by one, and add it to the count variable.

    function makeArrayConsecutive2(statues) {
    statues.sort(function(a,b) {return a – b});
    var count = 0;
    for (var i = 1; i < statues.length; i++) {
    if (statues[i] – statues[i-1] !== 1) {
    missing += statues[i] – statues[i-1] – 1;
    }
    }
    return count;
    }

    Reply
  9. Antonio Perez says:
    3 years ago

    The for loop could be from min+1 to max-1, right? Because the min and max values are always in the array

    Reply
  10. Michel Vorwieger says:
    3 years ago

    you can just do this : return (Math.max(…statues )- Math.min(…statues))-(statues.length-1);
    basically i dont sort it and just get the max and min

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tin Hot

LMHT: Công bố update bản 11.2, Riot sẽ cân bằng được các item Thần Thoại của tướng Chống chịu?

LMHT: Công bố update bản 11.2, Riot sẽ cân bằng được các item Thần Thoại của tướng Chống chịu?

January 13, 2021
LMHT: Đừng quá ngạc nhiên khi người Đi rừng ở mùa 11 chơi ích kỷ, Riot đang khiến họ làm vậy

LMHT: Đừng quá ngạc nhiên khi người Đi rừng ở mùa 11 chơi ích kỷ, Riot đang khiến họ làm vậy

January 13, 2021
LMHT: Lối chơi Fiora Thần Kiếm Muramana bỗng nhiên trở nên cực hot, tới tuyển thủ T1 còn phải “nghiện”

LMHT: Lối chơi Fiora Thần Kiếm Muramana bỗng nhiên trở nên cực hot, tới tuyển thủ T1 còn phải “nghiện”

January 13, 2021
T1 đang dần “lộ nguyên hình”, hút máu trên sự nổi tiếng của Faker?

T1 đang dần “lộ nguyên hình”, hút máu trên sự nổi tiếng của Faker?

January 13, 2021
Đội hình siêu dị đang sở hữu tỷ lệ thắng cao nhất LMHT phiên bản 11.1, Swain và Taric gây sốc

Đội hình siêu dị đang sở hữu tỷ lệ thắng cao nhất LMHT phiên bản 11.1, Swain và Taric gây sốc

January 13, 2021
LMHT: Xạ thủ tiếp tục bị nerf chỉ vì item chí mạng quá mạnh trên một vài tướng Đấu sĩ, Sát thủ

LMHT: Xạ thủ tiếp tục bị nerf chỉ vì item chí mạng quá mạnh trên một vài tướng Đấu sĩ, Sát thủ

January 13, 2021

Kinh nghiệm chơi game, chơi game gì thu hút ? Đọc ngay tin giải trí, game, siêu công nghệ không chỉ ở Việt Nam mà còn trên thế giới đã và đang được cập nhật tại đây

Xem lịch thi đấu world cup 2022 hôm nay mới nhất tại đây

  • Chính Sách Bảo Mật
  • Liên Hệ

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Liên Minh Huyền Thoại
  • Game
  • Công Nghệ

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.