Google Kick Start Practice Round 2019 - Mural The 2019 Stack Overflow Developer Survey Results Are InCodeChef - Please like meFinding the intersection of two sets of integersHackerrank New Year ChaosOptimize Performance challenge 'Vinay Queried 'Find the number of substrings of a numerical string greater than a given num stringSolution to Google Code Jam 2008 round 1C problem BPiling Up with PythonPython solution to Code Jam's 'Rounding Error'Hackerrank All Women's Codesprint 2019: Visually Balanced SectionsGoogle Kickstart Round A 2019 - Training
Can there be female White Walkers?
Worn-tile Scrabble
How do PCB vias affect signal quality?
What's the name of these plastic connectors
How come people say “Would of”?
Button changing its text & action. Good or terrible?
How to type a long/em dash `—`
Likelihood that a superbug or lethal virus could come from a landfill
What is the most efficient way to store a numeric range?
Are turbopumps lubricated?
How much of the clove should I use when using big garlic heads?
Will it cause any balance problems to have PCs level up and gain the benefits of a long rest mid-fight?
Is it possible for absolutely everyone to attain enlightenment?
Cooking pasta in a water boiler
What does Linus Torvalds mean when he says that Git "never ever" tracks a file?
Did any laptop computers have a built-in 5 1/4 inch floppy drive?
How to display lines in a file like ls displays files in a directory?
Why don't hard Brexiteers insist on a hard border to prevent illegal immigration after Brexit?
What do these terms in Caesar's Gallic wars mean?
Star Trek - X-shaped Item on Regula/Orbital Office Starbases
How to obtain a position of last non-zero element
Is Cinnamon a desktop environment or a window manager? (Or both?)
Geography at the pixel level
Can withdrawing asylum be illegal?
Google Kick Start Practice Round 2019 - Mural
The 2019 Stack Overflow Developer Survey Results Are InCodeChef - Please like meFinding the intersection of two sets of integersHackerrank New Year ChaosOptimize Performance challenge 'Vinay Queried 'Find the number of substrings of a numerical string greater than a given num stringSolution to Google Code Jam 2008 round 1C problem BPiling Up with PythonPython solution to Code Jam's 'Rounding Error'Hackerrank All Women's Codesprint 2019: Visually Balanced SectionsGoogle Kickstart Round A 2019 - Training
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
My code exceeds the time limit on the second test set. A suggestion/hint of a better algorithm would be appreciated.
Problem
Thanh wants to paint a wonderful mural on a wall that is N sections long. Each section of the wall has a beauty score, which indicates how beautiful it will look if it is painted. Unfortunately, the wall is starting to crumble due to a recent flood, so he will need to work fast!
At the beginning of each day, Thanh will paint one of the sections of the wall. On the first day, he is free to paint any section he likes. On each subsequent day, he must paint a new section that is next to a section he has already painted, since he does not want to split up the mural.
At the end of each day, one section of the wall will be destroyed. It is always a section of wall that is adjacent to only one other section and is unpainted (Thanh is using a waterproof paint, so painted sections can't be destroyed).
The total beauty of Thanh's mural will be equal to the sum of the beauty scores of the sections he has painted. Thanh would like to guarantee that, no matter how the wall is destroyed, he can still achieve a total beauty of at least B. What's the maximum value of B for which he can make this guarantee?
Input
The first line of the input gives the number of test cases, T. T test cases follow. Each test case starts with a line containing an integer N. Then, another line follows containing a string of N digits from 0 to 9. The i-th digit represents the beauty score of the i-th section of the wall.
Output
For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the maximum beauty score that Thanh can guarantee that he can achieve, as described above.
Limits
- 1 ≤ T ≤ 100.
- Time limit: 20 seconds per test set.
- Memory limit: 1 GB.
Small dataset (Test set 1 - Visible)
2 ≤ N ≤ 100.
Large dataset (Test set 2 - Hidden)
For exactly 1 case, N = 5 × 10^6; for the other T - 1 cases, 2 ≤ N ≤ 100.
Sample
Input
4
4
1332
4
9583
3
616
10
1029384756
Output
Case #1: 6
Case #2: 14
Case #3: 7
Case #4: 31
In the first sample case, Thanh can get a total beauty of 6, no matter how the wall is destroyed. On the first day, he can paint either section of wall with beauty score 3. At the end of the day, either the 1st section or the 4th section will be destroyed, but it does not matter which one. On the second day, he can paint the other section with beauty score 3.
In the second sample case, Thanh can get a total beauty of 14, by painting the leftmost section of wall (with beauty score 9). The only section of wall that can be destroyed is the rightmost one, since the leftmost one is painted. On the second day, he can paint the second leftmost section with beauty score 5. Then the last unpainted section of wall on the right is destroyed. Note that on the second day, Thanh cannot choose to paint the third section of wall (with beauty score 8), since it is not adjacent to any other painted sections.
In the third sample case, Thanh can get a total beauty of 7. He begins by painting the section in the middle (with beauty score 1). Whichever section is destroyed at the end of the day, he can paint the remaining wall at the start of the second day.
My solution
T = int(input()) # number of tries in test set
for i in range(1,T+1):
N = int(input()) # number of sections of wall
score_input = input() # string input of beauty scores
beauty_scores = [int(x) for x in score_input]
muralLength = (N+1)//2
bestScore = 0 # to obtain best beauty score
for k in range((N+2)//2): # the no. of possible murals
score = sum(beauty_scores[k:k+muralLength])
if score > bestScore:
bestScore = score
print("Case #: ".format(i, bestScore))
Further details
My code worked fine for the first test set, but the time limit was exceeded for the second. The most likely outcome is that with the test case N = 5 x 10^6, there was far too many mural options for the code to check (2500001 to be exact.)
python python-3.x programming-challenge time-limit-exceeded
New contributor
$endgroup$
add a comment |
$begingroup$
My code exceeds the time limit on the second test set. A suggestion/hint of a better algorithm would be appreciated.
Problem
Thanh wants to paint a wonderful mural on a wall that is N sections long. Each section of the wall has a beauty score, which indicates how beautiful it will look if it is painted. Unfortunately, the wall is starting to crumble due to a recent flood, so he will need to work fast!
At the beginning of each day, Thanh will paint one of the sections of the wall. On the first day, he is free to paint any section he likes. On each subsequent day, he must paint a new section that is next to a section he has already painted, since he does not want to split up the mural.
At the end of each day, one section of the wall will be destroyed. It is always a section of wall that is adjacent to only one other section and is unpainted (Thanh is using a waterproof paint, so painted sections can't be destroyed).
The total beauty of Thanh's mural will be equal to the sum of the beauty scores of the sections he has painted. Thanh would like to guarantee that, no matter how the wall is destroyed, he can still achieve a total beauty of at least B. What's the maximum value of B for which he can make this guarantee?
Input
The first line of the input gives the number of test cases, T. T test cases follow. Each test case starts with a line containing an integer N. Then, another line follows containing a string of N digits from 0 to 9. The i-th digit represents the beauty score of the i-th section of the wall.
Output
For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the maximum beauty score that Thanh can guarantee that he can achieve, as described above.
Limits
- 1 ≤ T ≤ 100.
- Time limit: 20 seconds per test set.
- Memory limit: 1 GB.
Small dataset (Test set 1 - Visible)
2 ≤ N ≤ 100.
Large dataset (Test set 2 - Hidden)
For exactly 1 case, N = 5 × 10^6; for the other T - 1 cases, 2 ≤ N ≤ 100.
Sample
Input
4
4
1332
4
9583
3
616
10
1029384756
Output
Case #1: 6
Case #2: 14
Case #3: 7
Case #4: 31
In the first sample case, Thanh can get a total beauty of 6, no matter how the wall is destroyed. On the first day, he can paint either section of wall with beauty score 3. At the end of the day, either the 1st section or the 4th section will be destroyed, but it does not matter which one. On the second day, he can paint the other section with beauty score 3.
In the second sample case, Thanh can get a total beauty of 14, by painting the leftmost section of wall (with beauty score 9). The only section of wall that can be destroyed is the rightmost one, since the leftmost one is painted. On the second day, he can paint the second leftmost section with beauty score 5. Then the last unpainted section of wall on the right is destroyed. Note that on the second day, Thanh cannot choose to paint the third section of wall (with beauty score 8), since it is not adjacent to any other painted sections.
In the third sample case, Thanh can get a total beauty of 7. He begins by painting the section in the middle (with beauty score 1). Whichever section is destroyed at the end of the day, he can paint the remaining wall at the start of the second day.
My solution
T = int(input()) # number of tries in test set
for i in range(1,T+1):
N = int(input()) # number of sections of wall
score_input = input() # string input of beauty scores
beauty_scores = [int(x) for x in score_input]
muralLength = (N+1)//2
bestScore = 0 # to obtain best beauty score
for k in range((N+2)//2): # the no. of possible murals
score = sum(beauty_scores[k:k+muralLength])
if score > bestScore:
bestScore = score
print("Case #: ".format(i, bestScore))
Further details
My code worked fine for the first test set, but the time limit was exceeded for the second. The most likely outcome is that with the test case N = 5 x 10^6, there was far too many mural options for the code to check (2500001 to be exact.)
python python-3.x programming-challenge time-limit-exceeded
New contributor
$endgroup$
$begingroup$
Welcome to Code Review! I hope you will get some great reviews.
$endgroup$
– Alex
1 hour ago
add a comment |
$begingroup$
My code exceeds the time limit on the second test set. A suggestion/hint of a better algorithm would be appreciated.
Problem
Thanh wants to paint a wonderful mural on a wall that is N sections long. Each section of the wall has a beauty score, which indicates how beautiful it will look if it is painted. Unfortunately, the wall is starting to crumble due to a recent flood, so he will need to work fast!
At the beginning of each day, Thanh will paint one of the sections of the wall. On the first day, he is free to paint any section he likes. On each subsequent day, he must paint a new section that is next to a section he has already painted, since he does not want to split up the mural.
At the end of each day, one section of the wall will be destroyed. It is always a section of wall that is adjacent to only one other section and is unpainted (Thanh is using a waterproof paint, so painted sections can't be destroyed).
The total beauty of Thanh's mural will be equal to the sum of the beauty scores of the sections he has painted. Thanh would like to guarantee that, no matter how the wall is destroyed, he can still achieve a total beauty of at least B. What's the maximum value of B for which he can make this guarantee?
Input
The first line of the input gives the number of test cases, T. T test cases follow. Each test case starts with a line containing an integer N. Then, another line follows containing a string of N digits from 0 to 9. The i-th digit represents the beauty score of the i-th section of the wall.
Output
For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the maximum beauty score that Thanh can guarantee that he can achieve, as described above.
Limits
- 1 ≤ T ≤ 100.
- Time limit: 20 seconds per test set.
- Memory limit: 1 GB.
Small dataset (Test set 1 - Visible)
2 ≤ N ≤ 100.
Large dataset (Test set 2 - Hidden)
For exactly 1 case, N = 5 × 10^6; for the other T - 1 cases, 2 ≤ N ≤ 100.
Sample
Input
4
4
1332
4
9583
3
616
10
1029384756
Output
Case #1: 6
Case #2: 14
Case #3: 7
Case #4: 31
In the first sample case, Thanh can get a total beauty of 6, no matter how the wall is destroyed. On the first day, he can paint either section of wall with beauty score 3. At the end of the day, either the 1st section or the 4th section will be destroyed, but it does not matter which one. On the second day, he can paint the other section with beauty score 3.
In the second sample case, Thanh can get a total beauty of 14, by painting the leftmost section of wall (with beauty score 9). The only section of wall that can be destroyed is the rightmost one, since the leftmost one is painted. On the second day, he can paint the second leftmost section with beauty score 5. Then the last unpainted section of wall on the right is destroyed. Note that on the second day, Thanh cannot choose to paint the third section of wall (with beauty score 8), since it is not adjacent to any other painted sections.
In the third sample case, Thanh can get a total beauty of 7. He begins by painting the section in the middle (with beauty score 1). Whichever section is destroyed at the end of the day, he can paint the remaining wall at the start of the second day.
My solution
T = int(input()) # number of tries in test set
for i in range(1,T+1):
N = int(input()) # number of sections of wall
score_input = input() # string input of beauty scores
beauty_scores = [int(x) for x in score_input]
muralLength = (N+1)//2
bestScore = 0 # to obtain best beauty score
for k in range((N+2)//2): # the no. of possible murals
score = sum(beauty_scores[k:k+muralLength])
if score > bestScore:
bestScore = score
print("Case #: ".format(i, bestScore))
Further details
My code worked fine for the first test set, but the time limit was exceeded for the second. The most likely outcome is that with the test case N = 5 x 10^6, there was far too many mural options for the code to check (2500001 to be exact.)
python python-3.x programming-challenge time-limit-exceeded
New contributor
$endgroup$
My code exceeds the time limit on the second test set. A suggestion/hint of a better algorithm would be appreciated.
Problem
Thanh wants to paint a wonderful mural on a wall that is N sections long. Each section of the wall has a beauty score, which indicates how beautiful it will look if it is painted. Unfortunately, the wall is starting to crumble due to a recent flood, so he will need to work fast!
At the beginning of each day, Thanh will paint one of the sections of the wall. On the first day, he is free to paint any section he likes. On each subsequent day, he must paint a new section that is next to a section he has already painted, since he does not want to split up the mural.
At the end of each day, one section of the wall will be destroyed. It is always a section of wall that is adjacent to only one other section and is unpainted (Thanh is using a waterproof paint, so painted sections can't be destroyed).
The total beauty of Thanh's mural will be equal to the sum of the beauty scores of the sections he has painted. Thanh would like to guarantee that, no matter how the wall is destroyed, he can still achieve a total beauty of at least B. What's the maximum value of B for which he can make this guarantee?
Input
The first line of the input gives the number of test cases, T. T test cases follow. Each test case starts with a line containing an integer N. Then, another line follows containing a string of N digits from 0 to 9. The i-th digit represents the beauty score of the i-th section of the wall.
Output
For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the maximum beauty score that Thanh can guarantee that he can achieve, as described above.
Limits
- 1 ≤ T ≤ 100.
- Time limit: 20 seconds per test set.
- Memory limit: 1 GB.
Small dataset (Test set 1 - Visible)
2 ≤ N ≤ 100.
Large dataset (Test set 2 - Hidden)
For exactly 1 case, N = 5 × 10^6; for the other T - 1 cases, 2 ≤ N ≤ 100.
Sample
Input
4
4
1332
4
9583
3
616
10
1029384756
Output
Case #1: 6
Case #2: 14
Case #3: 7
Case #4: 31
In the first sample case, Thanh can get a total beauty of 6, no matter how the wall is destroyed. On the first day, he can paint either section of wall with beauty score 3. At the end of the day, either the 1st section or the 4th section will be destroyed, but it does not matter which one. On the second day, he can paint the other section with beauty score 3.
In the second sample case, Thanh can get a total beauty of 14, by painting the leftmost section of wall (with beauty score 9). The only section of wall that can be destroyed is the rightmost one, since the leftmost one is painted. On the second day, he can paint the second leftmost section with beauty score 5. Then the last unpainted section of wall on the right is destroyed. Note that on the second day, Thanh cannot choose to paint the third section of wall (with beauty score 8), since it is not adjacent to any other painted sections.
In the third sample case, Thanh can get a total beauty of 7. He begins by painting the section in the middle (with beauty score 1). Whichever section is destroyed at the end of the day, he can paint the remaining wall at the start of the second day.
My solution
T = int(input()) # number of tries in test set
for i in range(1,T+1):
N = int(input()) # number of sections of wall
score_input = input() # string input of beauty scores
beauty_scores = [int(x) for x in score_input]
muralLength = (N+1)//2
bestScore = 0 # to obtain best beauty score
for k in range((N+2)//2): # the no. of possible murals
score = sum(beauty_scores[k:k+muralLength])
if score > bestScore:
bestScore = score
print("Case #: ".format(i, bestScore))
Further details
My code worked fine for the first test set, but the time limit was exceeded for the second. The most likely outcome is that with the test case N = 5 x 10^6, there was far too many mural options for the code to check (2500001 to be exact.)
python python-3.x programming-challenge time-limit-exceeded
python python-3.x programming-challenge time-limit-exceeded
New contributor
New contributor
New contributor
asked 2 hours ago
Lewis T.Lewis T.
112
112
New contributor
New contributor
$begingroup$
Welcome to Code Review! I hope you will get some great reviews.
$endgroup$
– Alex
1 hour ago
add a comment |
$begingroup$
Welcome to Code Review! I hope you will get some great reviews.
$endgroup$
– Alex
1 hour ago
$begingroup$
Welcome to Code Review! I hope you will get some great reviews.
$endgroup$
– Alex
1 hour ago
$begingroup$
Welcome to Code Review! I hope you will get some great reviews.
$endgroup$
– Alex
1 hour ago
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
A time to compute sum(beauty_scores[k:k+muralLength])
is proportional to muralLength
, which is N/2
, and there are N/2
iterations. Total time to execute the loop is $O(N^2)$. TLE.
As a hint, once you've computed the sum for a [0..m]
slice, the sum for next slice ([1..m+1]
) can be computed much faster. I don't want to say more.
range(1, T+1)
is unconventional, considering that i
is never used. Also, Pythonic style recommends to use _
for a dummy loop variable:
for _ in range(T):
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
);
);
, "mathjax-editing");
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "196"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Lewis T. is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f217289%2fgoogle-kick-start-practice-round-2019-mural%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
A time to compute sum(beauty_scores[k:k+muralLength])
is proportional to muralLength
, which is N/2
, and there are N/2
iterations. Total time to execute the loop is $O(N^2)$. TLE.
As a hint, once you've computed the sum for a [0..m]
slice, the sum for next slice ([1..m+1]
) can be computed much faster. I don't want to say more.
range(1, T+1)
is unconventional, considering that i
is never used. Also, Pythonic style recommends to use _
for a dummy loop variable:
for _ in range(T):
$endgroup$
add a comment |
$begingroup$
A time to compute sum(beauty_scores[k:k+muralLength])
is proportional to muralLength
, which is N/2
, and there are N/2
iterations. Total time to execute the loop is $O(N^2)$. TLE.
As a hint, once you've computed the sum for a [0..m]
slice, the sum for next slice ([1..m+1]
) can be computed much faster. I don't want to say more.
range(1, T+1)
is unconventional, considering that i
is never used. Also, Pythonic style recommends to use _
for a dummy loop variable:
for _ in range(T):
$endgroup$
add a comment |
$begingroup$
A time to compute sum(beauty_scores[k:k+muralLength])
is proportional to muralLength
, which is N/2
, and there are N/2
iterations. Total time to execute the loop is $O(N^2)$. TLE.
As a hint, once you've computed the sum for a [0..m]
slice, the sum for next slice ([1..m+1]
) can be computed much faster. I don't want to say more.
range(1, T+1)
is unconventional, considering that i
is never used. Also, Pythonic style recommends to use _
for a dummy loop variable:
for _ in range(T):
$endgroup$
A time to compute sum(beauty_scores[k:k+muralLength])
is proportional to muralLength
, which is N/2
, and there are N/2
iterations. Total time to execute the loop is $O(N^2)$. TLE.
As a hint, once you've computed the sum for a [0..m]
slice, the sum for next slice ([1..m+1]
) can be computed much faster. I don't want to say more.
range(1, T+1)
is unconventional, considering that i
is never used. Also, Pythonic style recommends to use _
for a dummy loop variable:
for _ in range(T):
answered 32 mins ago
vnpvnp
40.7k234103
40.7k234103
add a comment |
add a comment |
Lewis T. is a new contributor. Be nice, and check out our Code of Conduct.
Lewis T. is a new contributor. Be nice, and check out our Code of Conduct.
Lewis T. is a new contributor. Be nice, and check out our Code of Conduct.
Lewis T. is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Code Review Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f217289%2fgoogle-kick-start-practice-round-2019-mural%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Welcome to Code Review! I hope you will get some great reviews.
$endgroup$
– Alex
1 hour ago